Skip to content

Commit

Permalink
Do not mention the man page in --help on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
acuteenvy committed Nov 15, 2023
1 parent 6b6036c commit 07c8277
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ const DEFAULT_PLATFORM: &str = if cfg!(target_os = "linux") {
"common"
};

const AFTER_HELP: &str = if cfg!(target_os = "windows") {
// Man pages are not available on Windows.
"See https://tldr.sh/tlrc for more information."
} else {
"See 'man tldr' or https://tldr.sh/tlrc for more information."
};

#[derive(Parser)]
#[command(
arg_required_else_help = true,
Expand All @@ -30,7 +37,7 @@ const DEFAULT_PLATFORM: &str = if cfg!(target_os = "linux") {
// (the variable is not present yet in the build script).
version = option_env!("VERSION_STRING").unwrap_or(env!("CARGO_PKG_VERSION")),
disable_version_flag = true,
after_help = "See 'man tldr' or https://tldr.sh/tlrc for more information.",
after_help = AFTER_HELP,
help_template = "{before-help}{name} {version}\n\
{about-with-newline}\n\
{usage-heading} {usage}\n\n\
Expand Down

0 comments on commit 07c8277

Please sign in to comment.