Commit 1d0098ded6
Unsigned
Layout: unified · split
src/commands/matrix.rs +1
| @@ -339,6 +339,7 @@ impl CommandCallback for MatrixCommand { | ||
| 339 | 339 | .subcommand( |
| 340 | 340 | SubCommand::with_name("verification") |
| 341 | 341 | .about(VerificationCommand::DESCRIPTION) |
| 342 | .settings(VerificationCommand::SETTINGS) | |
| 342 | 343 | .subcommands(VerificationCommand::subcommands()), |
| 343 | 344 | ) |
| 344 | 345 | .subcommand( |
src/commands/verification.rs +7 −4
| @@ -26,6 +26,12 @@ impl VerificationCommand { | ||
| 26 | 26 | "Control interactive verification flows"; |
| 27 | 27 | |
| 28 | 28 | pub const COMPLETION: &'static str = "accept|confirm|cancel"; |
| 29 | pub const SETTINGS: &'static [ArgParseSettings] = &[ | |
| 30 | ArgParseSettings::DisableHelpFlags, | |
| 31 | ArgParseSettings::DisableVersion, | |
| 32 | ArgParseSettings::VersionlessSubcommands, | |
| 33 | ArgParseSettings::SubcommandRequiredElseHelp, | |
| 34 | ]; | |
| 29 | 35 | |
| 30 | 36 | pub fn create(servers: &Servers) -> Result<Command, ()> { |
| 31 | 37 | let settings = CommandSettings::new("verification") |
| @@ -104,10 +110,7 @@ impl CommandCallback for VerificationCommand { | ||
| 104 | 110 | fn callback(&mut self, _: &Weechat, buffer: &Buffer, arguments: Args) { |
| 105 | 111 | let argparse = Argparse::new("verification") |
| 106 | 112 | .about(Self::DESCRIPTION) |
| 107 | .global_setting(ArgParseSettings::DisableHelpFlags) | |
| 108 | .global_setting(ArgParseSettings::DisableVersion) | |
| 109 | .global_setting(ArgParseSettings::VersionlessSubcommands) | |
| 110 | .setting(ArgParseSettings::SubcommandRequiredElseHelp) | |
| 113 | .settings(Self::SETTINGS) | |
| 111 | 114 | .subcommands(Self::subcommands()); |
| 112 | 115 | |
| 113 | 116 | parse_and_run(argparse, arguments, |matches| { |