Skip to content

Commit

Permalink
Merge pull request #4190 from epage/nxt
Browse files Browse the repository at this point in the history
fix(help):Be dense on short next line help
  • Loading branch information
epage committed Sep 7, 2022
2 parents 69dd145 + bbb6c38 commit 65c2897
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -259,6 +259,7 @@ Deprecated
- *(help)* Trim extra whitespace to avoid artifacts from different uses of templates (#4132, #4156)
- *(help)* Hint to the user the difference between `-h` / `--help` when applicable (#4132, #4159)
- *(help)* Shorten help by eliding name/version/author (#4132, #4160)
- *(help)* When short help is long enough to activate `next_line_help`, don't add blank lines (#4132, #4190)
- *(version)* Use `Command::display_name` rather than `Command::bin_name` (#3966)
- *(parser)* Always fill in `""` argument for external subcommands (#3263)
- *(parser)* Short flags now have higher precedence than hyphen values with `Arg::allow_hyphen_values`, like `Command::allow_hyphen_values` (#4187)
Expand Down
3 changes: 0 additions & 3 deletions examples/tutorial_builder/02_app_settings.md
Expand Up @@ -7,13 +7,10 @@ Usage: 02_app_settings[EXE] --two <VALUE> --one <VALUE>
Options:
--two <VALUE>

--one <VALUE>

-h, --help
Print help information

-V, --version
Print version information

Expand Down
3 changes: 0 additions & 3 deletions examples/tutorial_derive/02_app_settings.md
Expand Up @@ -7,13 +7,10 @@ Usage: 02_app_settings_derive[EXE] --two <TWO> --one <ONE>
Options:
--two <TWO>

--one <ONE>

-h, --help
Print help information

-V, --version
Print version information

Expand Down
2 changes: 1 addition & 1 deletion src/output/help.rs
Expand Up @@ -438,7 +438,7 @@ impl<'cmd, 'writer> Help<'cmd, 'writer> {
for (i, (_, arg)) in ord_v.iter().enumerate() {
if i != 0 {
self.none("\n");
if next_line_help {
if next_line_help && self.use_long {
self.none("\n");
}
}
Expand Down
9 changes: 0 additions & 9 deletions tests/builder/help.rs
Expand Up @@ -355,17 +355,13 @@ Options:
-a, --all
Also do versioning for private crates (will not be
published)
--exact
Specify inter dependency version numbers exactly with
`=`
--no-git-commit
Do not commit version changes
--no-git-push
Do not push generated commit and tags to git remote
-h, --help
Print help information
";
Expand Down Expand Up @@ -694,10 +690,8 @@ Options:
les marchés d\'exportation. Le café est
souvent une contribution majeure aux
exportations des régions productrices.
-h, --help
Print help information
-V, --version
Print version information
";
Expand Down Expand Up @@ -743,7 +737,6 @@ Options:
-h, --help
Print help
information
-V, --version
Print
version
Expand Down Expand Up @@ -816,7 +809,6 @@ Options:
that require an
emulator. See
https://github.com/rust-lang/rustup/wiki/Non-host-toolchains
-h, --help
Print help
information
Expand Down Expand Up @@ -1168,7 +1160,6 @@ Usage: ctest
Options:
-h, --help
Print help information
-V, --version
Print version
information
Expand Down

0 comments on commit 65c2897

Please sign in to comment.