Skip to content

Feature: tri-state banner size option#61

Open
cereda wants to merge 1 commit intoavelino:mainfrom
cereda:feature/banner-size
Open

Feature: tri-state banner size option#61
cereda wants to merge 1 commit intoavelino:mainfrom
cereda:feature/banner-size

Conversation

@cereda
Copy link
Copy Markdown
Contributor

@cereda cereda commented Feb 24, 2026

Here we go. 😉

I've implemented a tri-state option --banner-size to set the banner size:

Value Result
None No banner is displayed
Compact A compact, one-line banner
Normal ASCII art banner

(--banner-size compact should be equivalent to --compact-banner)

Speaking of which:

#[arg(long, group = "legacy", conflicts_with = "banner_size")]
compact_banner: bool,

I followed the deprecation route, so --compact-banner can be removed in two major releases (advise users to move to use --banner-size instead). Of couse, @avelino has the last word, so what he decides goes. 😉

To avoid an unnecessary level of complexity, --compact-banner (CLI) or compact_banner (configuration) has higher priority over --banner-size (CLI) or banner_size (configuration), so the removal of the deprecated option can be smooth.

Hope it flies! 🚀

Copy link
Copy Markdown
Owner

@avelino avelino left a comment

Choose a reason for hiding this comment

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

The tri-state idea is good, but there are some issues that block merge:

Blocker: does not compile

  • BannerSize::NORMAL does not exist — Rust enums are PascalCase, should be BannerSize::Normal
  • Same issue in the TOML test: banner_size = "NORMAL" won't deserialize without #[serde(rename_all)]
  • Need to align serde with clap. Suggestion: add #[serde(rename_all = "lowercase")] to the enum and use "normal", "compact", "none" in both CLI and TOML

Commented-out code

//compact_banner and //let compact_banner = config.compact_banner — remove these, commented-out code shouldn't go into main

Tests

  • Missing test for BannerSize::None (stub without echo, no banner)
  • Missing test for BannerSize::Compact
  • Missing test for compact_banner vs banner_size priority in config

Deprecation warning

--compact-banner is marked as deprecated in the help text, but no warning is emitted when used. Without that, nobody will know they need to migrate. Suggestion:

if compact_banner {
    tracing::warn!("--compact-banner is deprecated, use --banner-size compact instead");
}

Minor

BannerSize::None can be confused with Option::None — consider Off or Hidden

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.

2 participants