Skip to content

docs(man): document the "default" --theme special value - #4088

Open
ump45nose wants to merge 1 commit into
sharkdp:masterfrom
ump45nose:docs/man-theme-default-value
Open

ump45nose wants to merge 1 commit into
sharkdp:masterfrom
ump45nose:docs/man-theme-default-value

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

Description

--theme accepts default as a special value, but it is missing from the "Special values" list in the man page.

  • src/theme.rs:138-145 — ThemeName::new maps the literal string "default" to ThemeName::Default, so --theme=default / BAT_THEME=default is not a theme name lookup.
  • src/theme.rs:30-35 — default_theme(ColorScheme::Dark) is "Monokai Extended".
  • src/theme.rs:420-433 — the test default_dark_if_requested_explicitly_through_theme asserts that an explicitly requested ThemeName::Default resolves to the dark default theme for every detected color scheme, i.e. it does not adapt to the terminal.
  • The value is already used in the documentation that never defines it: README.md:738 shows bat --theme=default "$@".

The entry is added after light, matching the surrounding .IP style. Along the way this fixes a duplicated "where" on the auto:always entry (assets/manual/bat.1.in:187).

No changelog entry: CONTRIBUTING.md states one is not necessary for documentation updates, and the note there says the verifying workflow failure can be disregarded in that case.

Only assets/manual/bat.1.in is touched. The rendered bat.1 is gitignored (.gitignore:14) and produced at build time from this template by build/application.rs:42-43, and doc/long-help.txt is the --help snapshot checked by tests/integration_tests.rs:868 — both are generated from other sources, and the same special-values list in clap_app.rs:429-441 also omits default. I left the --help text alone to keep this to one file; say the word if you would rather it be extended there as well.

Checklist

  • Used the existing code style — the new entry reuses the .IP / prose form of its neighbours.
  • Added a changelog entry — not required for docs per CONTRIBUTING.md.
  • Confirmed that all relevant tests pass — docs-only change to a roff template; no Rust code and no clap_app.rs token was touched, so cargo test cannot be affected. I could not run cargo in my sandbox (the command was blocked by the environment), so this rests on the diff being template text only.
  • Confirmed that all relevant documentation was updated — this is the documentation fix.

Overlap: the open PRs editing nearby man-page text are #4012 (-b, --number-nonblank), #4086 (nonblank numbering), #4009 (BAT_WIDTH), #4078/#4077 (--fallback-syntax, --sanitize) and #4033 (grammar in the --style/--paging passages, plus clap_app.rs); none of them modify lines 181-194.

AI assistance disclosure: an AI tool was used to diff the man page against src/theme.rs and to locate the README.md:738 usage; I reviewed the enum, the constant and the test myself and can answer questions about the roff and theme semantics.

This branch has not been deployed

No deployments
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