Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(help):Be dense on short next line help #4190

Merged
merged 1 commit into from Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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