From dc0db358abe19481e475e10c32149b53370f1a1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:31 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/clap-3.2.20/examples/multicall-busybox.rs | 48 ------------------------ 1 file changed, 48 deletions(-) delete mode 100644 vendor/clap-3.2.20/examples/multicall-busybox.rs (limited to 'vendor/clap-3.2.20/examples/multicall-busybox.rs') diff --git a/vendor/clap-3.2.20/examples/multicall-busybox.rs b/vendor/clap-3.2.20/examples/multicall-busybox.rs deleted file mode 100644 index 2e7f976c1..000000000 --- a/vendor/clap-3.2.20/examples/multicall-busybox.rs +++ /dev/null @@ -1,48 +0,0 @@ -use std::path::PathBuf; -use std::process::exit; - -use clap::{value_parser, Arg, Command}; - -fn applet_commands() -> [Command<'static>; 2] { - [ - Command::new("true").about("does nothing successfully"), - Command::new("false").about("does nothing unsuccessfully"), - ] -} - -fn main() { - let cmd = Command::new(env!("CARGO_CRATE_NAME")) - .multicall(true) - .subcommand( - Command::new("busybox") - .arg_required_else_help(true) - .subcommand_value_name("APPLET") - .subcommand_help_heading("APPLETS") - .arg( - Arg::new("install") - .long("install") - .help("Install hardlinks for all subcommands in path") - .exclusive(true) - .takes_value(true) - .default_missing_value("/usr/local/bin") - .value_parser(value_parser!(PathBuf)) - .use_value_delimiter(false), - ) - .subcommands(applet_commands()), - ) - .subcommands(applet_commands()); - - let matches = cmd.get_matches(); - let mut subcommand = matches.subcommand(); - if let Some(("busybox", cmd)) = subcommand { - if cmd.contains_id("install") { - unimplemented!("Make hardlinks to the executable here"); - } - subcommand = cmd.subcommand(); - } - match subcommand { - Some(("false", _)) => exit(1), - Some(("true", _)) => exit(0), - _ => unreachable!("parser should ensure only valid subcommand names are used"), - } -} -- cgit v1.2.3