diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-11 13:33:16 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-11 13:33:16 -0800 |
commit | 33368b57aa077ac13448f4d4927dd8a77934f763 (patch) | |
tree | 03848906f726b308f493b50cca27af5aa239ae21 /adenosine-pds/src/bin | |
parent | 6a23af4d35eb87f4cfd7c70371a4f6f6cd87dad8 (diff) | |
download | adenosine-33368b57aa077ac13448f4d4927dd8a77934f763.tar.gz adenosine-33368b57aa077ac13448f4d4927dd8a77934f763.zip |
pds: manpage, shell completions
Diffstat (limited to 'adenosine-pds/src/bin')
-rw-r--r-- | adenosine-pds/src/bin/adenosine-pds.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/adenosine-pds/src/bin/adenosine-pds.rs b/adenosine-pds/src/bin/adenosine-pds.rs index b2044e1..d02b07c 100644 --- a/adenosine-pds/src/bin/adenosine-pds.rs +++ b/adenosine-pds/src/bin/adenosine-pds.rs @@ -37,6 +37,9 @@ struct Opt { #[structopt(global = true, long, short = "v", parse(from_occurrences))] verbose: i8, + #[structopt(long = "--shell-completions", hidden = true)] + shell_completions: Option<structopt::clap::Shell>, + #[structopt(subcommand)] cmd: Command, } @@ -128,6 +131,11 @@ fn main() -> Result<()> { dotenv::dotenv().ok(); let opt = Opt::from_args(); + if let Some(shell) = opt.shell_completions { + Opt::clap().gen_completions_to("adenosine", shell, &mut std::io::stdout()); + std::process::exit(0); + } + let log_level = match opt.verbose { std::i8::MIN..=-1 => "none", 0 => "warn", @@ -135,6 +143,7 @@ fn main() -> Result<()> { 2 => "debug", 3..=std::i8::MAX => "trace", }; + // hyper logging is very verbose, so crank that down even if everything else is more verbose let cli_filter = format!("{},hyper=error", log_level); // defer to env var config, fallback to CLI settings |