Skip to content

feat: handle redirects in examples#59

Merged
caarlos0 merged 3 commits intomainfrom
redirects
Jul 11, 2025
Merged

feat: handle redirects in examples#59
caarlos0 merged 3 commits intomainfrom
redirects

Conversation

@caarlos0
Copy link
Copy Markdown
Contributor

@caarlos0 caarlos0 commented Jul 9, 2025

looks like this:

CleanShot 2025-07-09 at 11 06 57@2x

@caarlos0 caarlos0 requested a review from Copilot July 9, 2025 14:07
@caarlos0 caarlos0 self-assigned this Jul 9, 2025
@caarlos0 caarlos0 added the enhancement New feature or request label Jul 9, 2025

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@caarlos0 caarlos0 requested a review from Copilot July 9, 2025 14:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the example output by adding support for shell redirection operators (e.g., >, <, 2>&1) and logical operators (&&, ||), and renames the sample command from simple to example.

  • Update golden files to reflect example command name and include redirect/pipe/or examples
  • Implement isRedirect and isRedirecting logic in help.go to style redirection tokens
  • Expand tests and real example code to cover new operators and subcommands

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testdata/TestSetup/with_examples/version.golden Rename expected version output from simple to example
testdata/TestSetup/with_examples/help.golden Update help examples, adding redirects, &&/`
help.go Add isRedirect function and isRedirecting flag in styling
fang_test.go Update test command to example, add subcommands and flags
example/main.go Update sample usage to include redirects and logical ops

@caarlos0 caarlos0 merged commit 58492d9 into main Jul 11, 2025
18 checks passed
@caarlos0 caarlos0 deleted the redirects branch July 11, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants