Skip to content

Commit

Permalink
docs: Update multiline usage override rules
Browse files Browse the repository at this point in the history
The styling of usage has changed in clap-rs#4188 such that the usage string is on
the same line as the "Usage:" title. Previously, the usage went on the line
below the title. As such, the rules have changed for how to make a
multiline usage format correctly.

These updated rules achieve the following output for the documented
example:

    Usage: myapp -X [-a] [-b] <file>
           myapp -Y [-c] <file1> <file2>
	   myapp -Z [-d|-e]
  • Loading branch information
jpgrayson committed Sep 27, 2022
1 parent a0c8c7d commit 1127a07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/builder/command.rs
Expand Up @@ -1662,7 +1662,7 @@ impl Command {
/// correctly by the default help formatter:
///
/// - Do not indent the first usage line.
/// - Indent all subsequent usage lines with four spaces.
/// - Indent all subsequent usage lines with seven spaces.
/// - The last line must not end with a newline.
///
/// # Examples
Expand All @@ -1680,8 +1680,8 @@ impl Command {
/// # use clap::{Command, Arg};
/// Command::new("myprog")
/// .override_usage(
/// "myapp -X [-a] [-b] <file>\n \
/// myapp -Y [-c] <file1> <file2>\n \
/// "myapp -X [-a] [-b] <file>\n \
/// myapp -Y [-c] <file1> <file2>\n \
/// myapp -Z [-d|-e]"
/// )
/// # ;
Expand Down

0 comments on commit 1127a07

Please sign in to comment.