You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clap = { version = "3.2.23", features = ["derive"] }
Minimal reproducible code
use clap::{Parser};#[derive(Parser,Debug)]#[clap(author, version, about, long_about = None)]pubstructConfig{/// Your username#[clap(short, long, value_parser)]username:String,/// Your password#[clap(short, long, value_parser)]password:String,/// Server URI#[clap(long, value_parser, default_value = "http://localhost:8581")]uri:String,/// Authorization keys file. Default to authorization-keys.yml in the current working directory.#[clap(long, value_parser, default_value = "authorization-keys.yml")]keyfile_path:String,/// Metrics webserver port (service /metrics for Prometheus scraper)#[clap(long, value_parser, default_value = "9123")]port:u16,}fnmain(){let _config = Config::parse();}
Steps to reproduce the bug with the above code
Run the command:
cargo run -- --help
Actual Behaviour
mycli 0.1.0
USAGE:
mycli [OPTIONS] --username <USERNAME> --password <PASSWORD>
OPTIONS:
-h, --help
Print help information
--keyfile-path <KEYFILE_PATH>
Authorization keys file. Default to authorization-keys.yml in the current working
directory [default: authorization-keys.yml]
-p, --password <PASSWORD>
Your password
--port <PORT>
Metrics webserver port (service /metrics for Prometheus scraper) [default: 9123]
-u, --username <USERNAME>
Your username
--uri <URI>
Server URI [default: http://localhost:8581]
-V, --version
Print version information
Expected Behaviour
mycli 0.1.0
USAGE:
mycli [OPTIONS] --username <USERNAME> --password <PASSWORD>
OPTIONS:
-h, --help Print help information
--keyfile-path <KEYFILEPATH> Authorization keys file. Default to authorization-keys.yml in
the current working directory [default:
authorization-keys.yml]
-p, --password <PASSWORD> Your password
--port <PORT> Metrics webserver port (service /metrics for Prometheus
scraper) [default: 9123]
-u, --username <USERNAME> Your username
--uri <URI> Server URI [default: http://localhost:8581]
-V, --version Print version information
Additional Context
The output shows extra new lines.
By changing the name of the parameter keyfile_path to keyfilepath the issue goes away.
Debug Output
No response
The text was updated successfully, but these errors were encountered:
epage
added
the
A-help
Area: documentation, including docs.rs, readme, examples, etc...
label
Jan 12, 2023
epage
changed the title
Bad formatting depending on the name of a parameter
Extra blank lines when the argument name is long enough in --helpJan 12, 2023
Please complete the following tasks
Rust Version
rustc 1.64.0 (a55dd71d5 2022-09-19)
Clap Version
clap = { version = "3.2.23", features = ["derive"] }
Minimal reproducible code
Steps to reproduce the bug with the above code
Run the command:
Actual Behaviour
Expected Behaviour
Additional Context
The output shows extra new lines.
By changing the name of the parameter
keyfile_path
tokeyfilepath
the issue goes away.Debug Output
No response
The text was updated successfully, but these errors were encountered: