• Home
  • Raw
  • Download

Lines Matching full:command

1 use clap::{arg, error::ErrorKind, Arg, ArgAction, Command};
7 let m = Command::new("test") in subcommand()
9 Command::new("some").arg( in subcommand()
32 let m = Command::new("test") in subcommand_none_given()
34 Command::new("some").arg( in subcommand_none_given()
51 let m = Command::new("test") in subcommand_multiple()
53 Command::new("some").arg( in subcommand_multiple()
60 Command::new("add").arg(Arg::new("roster").short('r')), in subcommand_multiple()
79 let m = Command::new("myprog") in single_alias()
80 .subcommand(Command::new("test").alias("do-stuff")) in single_alias()
88 let m = Command::new("myprog") in multiple_aliases()
89 .subcommand(Command::new("test").aliases(["do-stuff", "test-stuff"])) in multiple_aliases()
106 Usage: dym [COMMAND] in subcmd_did_you_mean_output()
111 let cmd = Command::new("dym").subcommand(Command::new("subcmd")); in subcmd_did_you_mean_output()
126 Usage: dym [COMMAND] in subcmd_did_you_mean_output_ambiguous()
131 let cmd = Command::new("dym") in subcmd_did_you_mean_output_ambiguous()
132 .subcommand(Command::new("test")) in subcmd_did_you_mean_output_ambiguous()
133 .subcommand(Command::new("temp")); in subcmd_did_you_mean_output_ambiguous()
146 Usage: dym [COMMAND] in subcmd_did_you_mean_output_arg()
151 let cmd = Command::new("dym") in subcmd_did_you_mean_output_arg()
152 .subcommand(Command::new("subcmd").arg(arg!(-s --subcmdarg <subcmdarg> "tests"))); in subcmd_did_you_mean_output_arg()
164 Usage: dym [COMMAND] in subcmd_did_you_mean_output_arg_false_positives()
169 let cmd = Command::new("dym") in subcmd_did_you_mean_output_arg_false_positives()
170 .subcommand(Command::new("subcmd").arg(arg!(-s --subcmdarg <subcmdarg> "tests"))); in subcmd_did_you_mean_output_arg_false_positives()
177 let m = Command::new("myprog") in alias_help()
178 .subcommand(Command::new("test").alias("do-stuff")) in alias_help()
187 Usage: clap-test [COMMAND] in visible_aliases_help_output()
198 let cmd = Command::new("clap-test").version("2.6").subcommand( in visible_aliases_help_output()
199 Command::new("test") in visible_aliases_help_output()
211 Usage: clap-test [COMMAND] in invisible_aliases_help_output()
222 let cmd = Command::new("clap-test") in invisible_aliases_help_output()
224 .subcommand(Command::new("test").about("Some help").alias("invisible")); in invisible_aliases_help_output()
231 let m = Command::new("prog") in replace()
233 Command::new("module").subcommand(Command::new("install").about("Install module")), in replace()
248 let res = Command::new("prog") in issue_1031_args_with_same_name()
250 .subcommand(Command::new("signer")) in issue_1031_args_with_same_name()
263 let res = Command::new("prog") in issue_1031_args_with_same_name_no_more_vals()
265 .subcommand(Command::new("signer")) in issue_1031_args_with_same_name_no_more_vals()
280 let res = Command::new("myprog") in issue_1161_multiple_hyphen_hyphen()
323 let m = Command::new("myprog") in issue_1722_not_emit_error_when_arg_follows_similar_to_a_subcommand()
324 .subcommand(Command::new("subcommand")) in issue_1722_not_emit_error_when_arg_follows_similar_to_a_subcommand()
335 let mut cmd = Command::new("myprog") in subcommand_placeholder_test()
336 .subcommand(Command::new("subcommand")) in subcommand_placeholder_test()
358 Usage: cmd [COMMAND] in subcommand_used_after_double_dash()
363 let cmd = Command::new("cmd").subcommand(Command::new("subcmd")); in subcommand_used_after_double_dash()
370 let m = Command::new("myprog") in subcommand_after_argument()
372 .subcommand(Command::new("test")) in subcommand_after_argument()
384 let m = Command::new("myprog") in subcommand_after_argument_looks_like_help()
386 .subcommand(Command::new("test")) in subcommand_after_argument_looks_like_help()
398 let cmd = Command::new("opt") in issue_2494_subcommand_is_present()
400 .subcommand(Command::new("global")); in issue_2494_subcommand_is_present()
424 let cmd = Command::new("fake") in subcommand_not_recognized()
425 .subcommand(Command::new("sub")) in subcommand_not_recognized()
433 Usage: fake [COMMAND] in subcommand_not_recognized()
443 fn applet_commands() -> [Command; 2] { in busybox_like_multicall()
444 [Command::new("true"), Command::new("false")] in busybox_like_multicall()
446 let cmd = Command::new("busybox") in busybox_like_multicall()
448 .subcommand(Command::new("busybox").subcommands(applet_commands())) in busybox_like_multicall()
468 let mut cmd = Command::new("hostname") in hostname_like_multicall()
470 .subcommand(Command::new("hostname")) in hostname_like_multicall()
471 .subcommand(Command::new("dnsdomainname")); in hostname_like_multicall()
495 let cmd = Command::new("repl") in bad_multicall_command_error()
499 .subcommand(Command::new("foo")) in bad_multicall_command_error()
500 .subcommand(Command::new("bar")); in bad_multicall_command_error()
507 Usage: <COMMAND> in bad_multicall_command_error()
523 Usage: <COMMAND> in bad_multicall_command_error()
546 #[should_panic = "Command repl: Arguments like oh-no cannot be set on a multicall command"]
548 let mut cmd = Command::new("repl") in cant_have_args_with_multicall()
552 .subcommand(Command::new("foo")) in cant_have_args_with_multicall()
553 .subcommand(Command::new("bar")) in cant_have_args_with_multicall()
570 let cmd = Command::new("repl") in multicall_help_flag()
574 .subcommand(Command::new("foo").subcommand(Command::new("bar").arg(Arg::new("value")))); in multicall_help_flag()
590 let cmd = Command::new("repl") in multicall_help_subcommand()
594 .subcommand(Command::new("foo").subcommand(Command::new("bar").arg(Arg::new("value")))); in multicall_help_subcommand()
610 let mut cmd = Command::new("repl") in multicall_render_help()
614 .subcommand(Command::new("foo").subcommand(Command::new("bar").arg(Arg::new("value")))); in multicall_render_help()
624 #[should_panic = "Command test: command name `repeat` is duplicated"]
626 Command::new("test") in duplicate_subcommand()
627 .subcommand(Command::new("repeat")) in duplicate_subcommand()
628 .subcommand(Command::new("repeat")) in duplicate_subcommand()
633 #[should_panic = "Command test: command `unique` alias `repeat` is duplicated"]
635 Command::new("test") in duplicate_subcommand_alias()
636 .subcommand(Command::new("repeat")) in duplicate_subcommand_alias()
637 .subcommand(Command::new("unique").alias("repeat")) in duplicate_subcommand_alias()