Skip to content

Commit

Permalink
docs(help): Include example with old template
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 30, 2022
1 parent db31881 commit 4eb3da2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/builder/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1758,13 +1758,31 @@ impl Command {
///
/// # Examples
///
/// For a very brief help:
///
/// ```no_run
/// # use clap::Command;
/// Command::new("myprog")
/// .version("1.0")
/// .help_template("{bin} ({version}) - {usage}")
/// # ;
/// ```
///
/// For showing more application context:
///
/// ```no_run
/// # use clap::Command;
/// Command::new("myprog")
/// .version("1.0")
/// .help_template("\
/// {before-help}{name} {version}
/// {author-with-newline}{about-with-newline}
/// {usage-heading} {usage}
///
/// {all-args}{after-help}
/// ")
/// # ;
/// ```
/// [`Command::about`]: Command::about()
/// [`Command::long_about`]: Command::long_about()
/// [`Command::after_help`]: Command::after_help()
Expand Down

0 comments on commit 4eb3da2

Please sign in to comment.