Add `-h` flag to binaries

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
This commit is contained in:
xphoniex 2023-07-20 11:34:36 +00:00 committed by Alexis Sellier
parent 0e54c4a293
commit 4869fe26e2
No known key found for this signature in database
31 changed files with 31 additions and 31 deletions

View File

@ -48,7 +48,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Long("to") => {

View File

@ -61,7 +61,7 @@ impl Args for Options {
Long("stdin") => {
stdin = true;
}
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
_ => return Err(anyhow::anyhow!(arg.unexpected())),

View File

@ -49,7 +49,7 @@ impl Args for Options {
Long("no-confirm") => {
// Ignored for now.
}
Long("help") => return Err(Error::Help.into()),
Long("help") | Short('h') => return Err(Error::Help.into()),
Long("remote") => {
let val = parser.value().unwrap();
remote = Some(term::args::did(&val)?);

View File

@ -74,7 +74,7 @@ impl Args for Options {
Long("announce") => {
announce = true;
}
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(val) if id.is_none() => {

View File

@ -66,7 +66,7 @@ impl Args for Options {
}
// Common.
Long("help") => return Err(Error::Help.into()),
Long("help") | Short('h') => return Err(Error::Help.into()),
Value(val) if id.is_none() => {
let val = string(&val);

View File

@ -68,7 +68,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Long("to") => {

View File

@ -40,7 +40,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(val) if id.is_none() => {

View File

@ -38,7 +38,7 @@ impl Args for Options {
if let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(val) if rid.is_none() => {

View File

@ -51,7 +51,7 @@ impl Args for Options {
if let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
_ => return Err(anyhow::anyhow!(arg.unexpected())),

View File

@ -133,7 +133,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Long("title") if op == Some(OperationName::Edit) => {

View File

@ -132,7 +132,7 @@ impl Args for Options {
Long("verbose") | Short('v') => {
verbose = true;
}
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(val) if path.is_none() => {

View File

@ -65,7 +65,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Long("refs") => {

View File

@ -135,7 +135,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Long("all") if op.is_none() || op == Some(OperationName::List) => {

View File

@ -36,7 +36,7 @@ impl Args for Options {
if let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Long("verbose") | Short('v') => verbose = true,

View File

@ -122,7 +122,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(val) if op.is_none() => match val.to_string_lossy().as_ref() {

View File

@ -251,7 +251,7 @@ impl Args for Options {
Long("verbose") | Short('v') => {
verbose = true;
}
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}

View File

@ -37,7 +37,7 @@ impl Args for Options {
#[allow(clippy::never_loop)]
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
_ => return Err(anyhow!(arg.unexpected())),

View File

@ -67,7 +67,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(args::Error::Help.into());
}
Long("name") | Short('n') => {

View File

@ -103,7 +103,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Long("revision") | Short('r') => {

View File

@ -49,7 +49,7 @@ impl Args for Options {
Long("no-confirm") => {
confirm = false;
}
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(val) if id.is_none() => {

View File

@ -71,7 +71,7 @@ impl Args for Options {
Long("ssh-fingerprint") if show.is_none() => {
show = Some(Show::SshFingerprint);
}
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
_ => return Err(anyhow::anyhow!(arg.unexpected())),

View File

@ -96,7 +96,7 @@ impl Args for Options {
timeout = time::Duration::from_secs(secs);
}
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(val) if rid.is_none() => {

View File

@ -44,7 +44,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(ref val) if id.is_none() => {

View File

@ -91,7 +91,7 @@ impl Args for Options {
(Long("fetch"), Some(Operation::TrackRepo { .. })) => fetch = true,
(Long("no-fetch"), Some(Operation::TrackRepo { .. })) => fetch = false,
(Long("verbose") | Short('v'), _) => verbose = true,
(Long("help"), _) => {
(Long("help") | Short('h'), _) => {
return Err(Error::Help.into());
}
_ => {

View File

@ -47,7 +47,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Long("from") => {

View File

@ -44,7 +44,7 @@ impl Args for Options {
while let Some(arg) = parser.next()? {
match arg {
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
Value(ref val) if id.is_none() => {

View File

@ -60,7 +60,7 @@ impl Args for Options {
}
}
(Long("verbose") | Short('v'), _) => verbose = true,
(Long("help"), _) => {
(Long("help") | Short('h'), _) => {
return Err(Error::Help.into());
}
_ => {

View File

@ -62,7 +62,7 @@ impl Args for Options {
frontend = Some(parser.value()?.to_string_lossy().to_string())
}
Long("json") => json = true,
Long("help") => {
Long("help") | Short('h') => {
return Err(Error::Help.into());
}
_ => {

View File

@ -64,7 +64,7 @@ fn parse_options() -> Result<httpd::Options, lexopt::Error> {
aliases.insert(alias, id);
}
Long("help") => {
Long("help") | Short('h') => {
println!("usage: radicle-httpd [--listen <addr>] [--alias <name> <rid>]..");
process::exit(0);
}

View File

@ -98,7 +98,7 @@ impl Options {
let addr = parser.value()?.parse()?;
listen.push(addr);
}
Long("help") => {
Long("help") | Short('h') => {
println!("{HELP_MSG}");
process::exit(0);
}

View File

@ -41,7 +41,7 @@ impl Options {
println!("{NAME} {VERSION}+{GIT_HEAD}");
process::exit(0);
}
Long("help") => {
Long("help") | Short('h') => {
println!("{HELP}");
process::exit(0);
}