mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-05 11:20:38 +08:00
bin: Handle --no-forward wo/ command correctly
This commit is contained in:
+13
-7
@@ -100,23 +100,29 @@ fn parse_args() -> anyhow::Result<Command> {
|
||||
let command = match command {
|
||||
Some(CommandName::Help) => {
|
||||
if forward {
|
||||
Some(Command::Other(vec!["help".into()]))
|
||||
Command::Other(vec!["help".into()])
|
||||
} else {
|
||||
Some(Command::Help)
|
||||
Command::Help
|
||||
}
|
||||
}
|
||||
Some(CommandName::Version) => {
|
||||
if forward {
|
||||
Some(Command::Other(vec!["version".into()]))
|
||||
Command::Other(vec!["version".into()])
|
||||
} else {
|
||||
Some(Command::Version { json })
|
||||
Command::Version { json }
|
||||
}
|
||||
}
|
||||
Some(CommandName::Other(args)) => Command::Other(args),
|
||||
_ => {
|
||||
if forward {
|
||||
Command::Other(vec!["help".into()])
|
||||
} else {
|
||||
Command::Other(vec![])
|
||||
}
|
||||
}
|
||||
Some(CommandName::Other(args)) => Some(Command::Other(args)),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
Ok(command.unwrap_or_else(|| Command::Other(vec![])))
|
||||
Ok(command)
|
||||
}
|
||||
|
||||
fn print_help() -> anyhow::Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user