Repository navigation
feat: add --help, --version and color controls - #5
Merged
Merged
Conversation
- --help / -h and --version / -v, both usable without Homebrew - --no-color; colors are also off with NO_COLOR (no-color.org) or when the output is piped or redirected, so `brewshelf > file` and `brewshelf | less` no longer contain escape codes - without colors, --all labels dependencies "(dependency)" instead of relying on dimmed text - unknown options point to --help - options are parsed before the Homebrew check - tests: help, version, colors in a pseudo-terminal, NO_COLOR, --no-color, piped output (59 checks)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #4. Merge after it.
Changes
brewshelf --helpbrewshelf --versionbrewshelf 1.0.0brewshelf > file/brewshelf | lessNO_COLOR=1(no-color.org)--no-color--allwithout colors(dependency)--helpand--versionwork on a machine without Homebrew.--help(exit 2).BREWSHELF_VERSION=1.0.0: the first tagged release will use this, and the Homebrew tap in the next PR needs it.Tests (59 checks, was 45)
Help, version,
--helpwithout Homebrew, colors in a pseudo-terminal (script),--no-color,NO_COLOR, piped output, dependency label without colors.Verified on a real machine: 55 escape sequences in a terminal, and 0 when piped, with
NO_COLOR, or with--no-color.