Skip to content

feat(cli): print the banner only for chosen commands - #49

Merged
dennis-tra merged 1 commit into
mainfrom
feat/banner-for-chosen-commands
Nov 24, 2026
Merged

dennis-tra merged 1 commit into
mainfrom
feat/banner-for-chosen-commands

Conversation

@dennis-tra

Copy link
Copy Markdown
Contributor

What and why

A tool with short commands and long-running ones wants the banner only for the long-running ones. Today the root command prints it for every command, and only --noBanner turns it off.

RootCommandConfig.BannerCommands lists the commands that print the banner. When the list is empty, every command prints it, as before. A command that is not in the list prints no banner, and neither does a run without a command. --noBanner, the environment variable and shell completion still switch the banner off.

The root command reads the command name from the first argument after the root flags. Only top-level commands are matched, not subcommands.

How I checked it

just ci passes. TestRootCommandBanner has new cases for a listed command, an unlisted command, a run without a command and --noBanner with a listed command.

Deploy

Nothing. The new field is optional and the default does not change.

Add RootCommandConfig.BannerCommands. When it names commands, only they
print the banner. An empty list keeps the old behaviour: every command
prints it.
@dennis-tra
dennis-tra merged commit fa4b8dd into main Nov 24, 2026
1 check passed
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