Skip to content

Commit

Permalink
Clap: Set UnifiedHelpMessage and DeriveDisplayOrder options
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed May 9, 2021
1 parent 8e40fea commit ac8f429
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
33 changes: 15 additions & 18 deletions docs/src/usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@ Danilo Bargen <mail@dbrgn.ch>
A fast TLDR client

USAGE:
tldr [FLAGS] [OPTIONS] [command]...
tldr [OPTIONS] [command]...

ARGS:
<command>... The command to show (e.g. `tar` or `git log`)

FLAGS:
-c, --clear-cache Clear the local cache
--config-path Show config file path
-h, --help Prints help information
-l, --list List all commands in the cache
-m, --markdown Display the raw markdown instead of rendering it
-p, --pager Use a pager to page output
-q, --quiet Suppress informational messages
--seed-config Create a basic config
--show-paths Show file and directory paths used by tealdeer
-u, --update Update the local cache
-v, --version Prints the version

OPTIONS:
--color <color> Control whether to use color [always, auto, never]
-L, --language <language> Override the language
-o, --os <os> Override the operating system [linux, macos, sunos, windows]
-l, --list List all commands in the cache
-f, --render <render> Render a specific markdown file

-o, --os <os> Override the operating system [linux, macos, sunos, windows]
-L, --language <language> Override the language
-u, --update Update the local cache
-c, --clear-cache Clear the local cache
-p, --pager Use a pager to page output
-q, --quiet Suppress informational messages
-m, --markdown Display the raw markdown instead of rendering it
--show-paths Show file and directory paths used by tealdeer
--config-path Show config file path
--seed-config Create a basic config
--color <color> Control whether to use color [always, auto, never]
-v, --version Prints the version
-h, --help Prints help information
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ const PAGER_COMMAND: &str = "less -R";
#[clap(about = "A fast TLDR client", author, version)]
#[clap(setting = AppSettings::ArgRequiredElseHelp)]
#[clap(setting = AppSettings::HelpRequired)]
#[clap(setting = AppSettings::DeriveDisplayOrder)]
#[clap(setting = AppSettings::UnifiedHelpMessage)]
struct Args {
/// The command to show (e.g. `tar` or `git log`)
#[clap(min_values = 1)]
Expand Down

0 comments on commit ac8f429

Please sign in to comment.