Skip to content

feat: add --help, --version and color controls - #5

Merged
batuhan-bas merged 1 commit into
mainfrom
feat/cli-options
Oct 8, 2026
Merged

batuhan-bas merged 1 commit into
mainfrom
feat/cli-options

Conversation

@batuhan-bas

Copy link
Copy Markdown
Owner

Stacked on #4. Merge after it.

Changes

Before After
brewshelf --help unknown option usage with all options
brewshelf --version – brewshelf 1.0.0
brewshelf > file / brewshelf | less raw escape codes in the output plain text
NO_COLOR=1 (no-color.org) ignored colors off
--no-color – colors off
--all without colors dependencies indistinguishable labelled (dependency)
  • Options are parsed before the Homebrew check, so --help and --version work on a machine without Homebrew.
  • Unknown options point to --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, --help without 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.

- --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)
Base automatically changed from feat/requested-vs-deps to main October 8, 2026 08:18
@batuhan-bas
batuhan-bas merged commit d21401c into main Oct 8, 2026
1 check passed
@batuhan-bas
batuhan-bas deleted the feat/cli-options branch October 8, 2026 08:18
@batuhan-bas batuhan-bas self-assigned this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant