• Home
  • Raw
  • Download

Lines Matching +full:test +full:- +full:utils

5 use super::utils;
7 fn setup() -> Command { in setup()
8 Command::new("test") in setup()
14 fn empty_args() -> impl IntoIterator<Item = String> { in empty_args()
18 #[test]
20 let m = setup().try_get_matches_from(vec!["myprog", "-h"]); in help_short()
26 #[test]
28 let m = setup().try_get_matches_from(vec!["myprog", "--help"]); in help_long()
34 #[test]
42 #[test]
46 Command::new("test") in help_subcommand()
48 .arg(arg!(-v --verbose "with verbosity")), in help_subcommand()
56 #[test]
57 #[cfg(feature = "error-context")]
66 -f --flag "tests flags" in help_multi_subcommand_error()
70 -o --option <scoption> "tests options" in help_multi_subcommand_error()
86 For more information, try '--help'. in help_multi_subcommand_error()
88 utils::assert_eq(EXPECTED, err.to_string()); in help_multi_subcommand_error()
91 #[test]
94 Usage: example <FIRST>... -- <SECOND>... in req_last_arg_usage()
101 -h, --help Print help in req_last_arg_usage()
102 -V, --version Print version in req_last_arg_usage()
115 utils::assert_output(cmd, "example --help", LAST_ARG_REQ_MULT, false); in req_last_arg_usage()
118 #[test]
121 Usage: flamegraph [OPTIONS] [BINFILE] [-- <ARGS>...] in args_with_last_usage()
128 -v, --verbose Prints out more stuff. in args_with_last_usage()
129 -t, --timeout <SECONDS> Timeout in seconds. in args_with_last_usage()
130 -f, --frequency <HERTZ> The sampling frequency. in args_with_last_usage()
131 -h, --help Print help in args_with_last_usage()
132 -V, --version Print version in args_with_last_usage()
171 utils::assert_output(cmd, "flamegraph --help", LAST_ARG_USAGE, false); in args_with_last_usage()
174 #[test]
176 let m = utils::complex_app().try_get_matches_from(vec!["clap-test", "subcmd", "-h"]); in subcommand_short_help()
182 #[test]
184 let m = utils::complex_app().try_get_matches_from(vec!["clap-test", "subcmd", "--help"]); in subcommand_long_help()
190 #[test]
192 let m = utils::complex_app().try_get_matches_from(vec!["clap-test", "help", "subcmd"]); in subcommand_help_rev()
198 #[test]
201 clap-test v1.4.8 in complex_help_output()
205 Usage: clap-test [OPTIONS] [positional] [positional2] [positional3]... [COMMAND] in complex_help_output()
217 -o, --option <opt>... tests options in complex_help_output()
218 -f, --flag... tests flags in complex_help_output()
219 -F tests flags with exclusions in complex_help_output()
220 --long-option-2 <option2> tests long options with exclusions in complex_help_output()
221 -O, --option3 <option3> specific vals [possible values: fast, slow] in complex_help_output()
222 --multvals <one> <two> Tests multiple values, not mult occs in complex_help_output()
223 --multvalsmo <one> <two> Tests multiple values, and mult occs in complex_help_output()
224 --minvals2 <minvals> <minvals>... Tests 2 min vals in complex_help_output()
225 --maxvals3 <maxvals>... Tests 3 max vals in complex_help_output()
226 --optvaleq[=<optval>] Tests optional value, require = sign in complex_help_output()
227 --optvalnoeq [<optval>] Tests optional value in complex_help_output()
228 -h, --help Print help in complex_help_output()
229 -V, --version Print version in complex_help_output()
232 utils::assert_output(utils::complex_app(), "clap-test --help", HELP, false); in complex_help_output()
235 #[test]
241 Usage: clap-test in after_and_before_help_output()
244 -h, --help Print help in after_and_before_help_output()
245 -V, --version Print version in after_and_before_help_output()
250 let cmd = Command::new("clap-test") in after_and_before_help_output()
255 utils::assert_output(cmd.clone(), "clap-test -h", AFTER_HELP, false); in after_and_before_help_output()
256 utils::assert_output(cmd, "clap-test --help", AFTER_HELP, false); in after_and_before_help_output()
259 #[test]
265 Usage: clap-test in after_and_before_long_help_output()
268 -h, --help Print help (see more with '--help') in after_and_before_long_help_output()
269 -V, --version Print version in after_and_before_long_help_output()
278 Usage: clap-test in after_and_before_long_help_output()
281 -h, --help in after_and_before_long_help_output()
282 Print help (see a summary with '-h') in after_and_before_long_help_output()
284 -V, --version in after_and_before_long_help_output()
290 let cmd = Command::new("clap-test") in after_and_before_long_help_output()
297 utils::assert_output(cmd.clone(), "clap-test --help", AFTER_LONG_HELP, false); in after_and_before_long_help_output()
298 utils::assert_output(cmd, "clap-test -h", AFTER_HELP, false); in after_and_before_long_help_output()
307 -f, --flag tests flags
308 -o, --option <scoption>... tests options
309 -h, --help Print help
310 -V, --version Print version
313 #[test]
322 -f --flag "tests flags" in multi_level_sc_help()
326 -o --option <scoption> "tests options" in multi_level_sc_help()
334 utils::assert_output(cmd, "ctest help subcmd multi", MULTI_SC_HELP, false); in multi_level_sc_help()
337 #[test]
343 -h, --help Print help in no_wrap_default_help()
344 -V, --version Print version in no_wrap_default_help()
348 utils::assert_output(cmd, "ctest --help", DEFAULT_HELP, false); in no_wrap_default_help()
351 #[test]
355 Usage: test [OPTIONS] in wrapped_help()
358 -a, --all Also do versioning for private crates (will in wrapped_help()
360 --exact Specify inter dependency version numbers in wrapped_help()
362 --no-git-commit Do not commit version changes in wrapped_help()
363 --no-git-push Do not push generated commit and tags to git in wrapped_help()
365 -h, --help Print help in wrapped_help()
367 let cmd = Command::new("test") in wrapped_help()
384 .long("no-git-commit") in wrapped_help()
390 .long("no-git-push") in wrapped_help()
394 utils::assert_output(cmd, "test --help", WRAPPED_HELP, false); in wrapped_help()
397 #[test]
401 Usage: test [OPTIONS] in unwrapped_help()
404 -a, --all Also do versioning for private crates (will in unwrapped_help()
406 --exact Specify inter dependency version numbers in unwrapped_help()
408 --no-git-commit Do not commit version changes in unwrapped_help()
409 --no-git-push Do not push generated commit and tags to git in unwrapped_help()
411 -h, --help Print help in unwrapped_help()
413 let cmd = Command::new("test") in unwrapped_help()
430 .long("no-git-commit") in unwrapped_help()
436 .long("no-git-push") in unwrapped_help()
440 utils::assert_output(cmd, "test --help", UNWRAPPED_HELP, false); in unwrapped_help()
443 #[test]
447 Usage: test [OPTIONS] in possible_value_wrapped_help()
450 --possible-values <possible_values> in possible_value_wrapped_help()
452 - short_name: in possible_value_wrapped_help()
454 - second: in possible_value_wrapped_help()
457 --possible-values-with-new-line <possible_values_with_new_line> in possible_value_wrapped_help()
459 - long enough name to trigger new line: in possible_value_wrapped_help()
462 - second in possible_value_wrapped_help()
464 --possible-values-without-new-line <possible_values_without_new_line> in possible_value_wrapped_help()
466 - name: Short enough help message with no wrapping in possible_value_wrapped_help()
467 - second: short help in possible_value_wrapped_help()
469 -h, --help in possible_value_wrapped_help()
470 Print help (see a summary with '-h') in possible_value_wrapped_help()
472 let cmd = Command::new("test") in possible_value_wrapped_help()
476 .long("possible-values") in possible_value_wrapped_help()
486 .long("possible-values-with-new-line") in possible_value_wrapped_help()
497 .long("possible-values-without-new-line") in possible_value_wrapped_help()
504 utils::assert_output(cmd, "test --help", WRAPPED_HELP, false); in possible_value_wrapped_help()
507 #[test]
509 static SC_HELP: &str = "clap-test-subcmd 0.1 in complex_subcommand_help_output()
513 Usage: clap-test subcmd [OPTIONS] [scpositional] in complex_subcommand_help_output()
519 -o, --option <scoption>... tests options in complex_subcommand_help_output()
520 -f, --flag... tests flags in complex_subcommand_help_output()
521 -s, --subcmdarg <subcmdarg> tests other args in complex_subcommand_help_output()
522 -h, --help Print help in complex_subcommand_help_output()
523 -V, --version Print version in complex_subcommand_help_output()
526 let a = utils::complex_app(); in complex_subcommand_help_output()
527 utils::assert_output(a, "clap-test subcmd --help", SC_HELP, false); in complex_subcommand_help_output()
530 #[test]
537 -c, --cafe <FILE> A coffeehouse, coffee shop, or café is an in issue_626_unicode_cutoff()
545 -h, --help Print help in issue_626_unicode_cutoff()
546 -V, --version Print version in issue_626_unicode_cutoff()
564 utils::assert_output(cmd, "ctest --help", ISSUE_626_CUTOFF, false); in issue_626_unicode_cutoff()
571 -p, --pos <VAL> Some vals [possible values: fast, slow]
572 -c, --cafe <FILE> A coffeehouse, coffee shop, or café.
573 -h, --help Print help
574 -V, --version Print version
577 #[test]
600 utils::assert_output(cmd, "ctest --help", HIDE_POS_VALS, false); in hide_possible_vals()
603 #[test]
628 utils::assert_output(cmd, "ctest --help", HIDE_POS_VALS, false); in hide_single_possible_val()
631 #[test]
637 -p, --pos <VAL> in possible_vals_with_help()
641 - fast in possible_vals_with_help()
642 - slow: not as fast in possible_vals_with_help()
644 -c, --cafe <FILE> in possible_vals_with_help()
647 -h, --help in possible_vals_with_help()
648 Print help (see a summary with '-h') in possible_vals_with_help()
650 -V, --version in possible_vals_with_help()
676 utils::assert_output(app, "ctest --help", POS_VALS_HELP, false); in possible_vals_with_help()
679 #[test]
688 -h, --help Print help in hidden_possible_vals()
699 utils::assert_output(app, "ctest --help", POS_VALS_HELP, false); in hidden_possible_vals()
702 #[test]
709 -c, --cafe <FILE> in issue_626_panic()
717 -h, --help in issue_626_panic()
719 -V, --version in issue_626_panic()
734 utils::assert_output(cmd, "ctest --help", ISSUE_626_PANIC, false); in issue_626_panic()
737 #[test]
752 .try_get_matches_from(vec!["ctest", "--help"]); in issue_626_variable_panic()
756 #[test]
763 -h, --help in final_word_wrapping()
765 -V, --version in final_word_wrapping()
770 utils::assert_output(cmd, "ctest --help", FINAL_WORD_WRAPPING, false); in final_word_wrapping()
773 #[test]
781 l, long Copy-friendly, 14 characters, in wrapping_newline_chars()
783 m, med, medium Copy-friendly, 8 characters, in wrapping_newline_chars()
787 -h, --help Print help in wrapping_newline_chars()
788 -V, --version Print version in wrapping_newline_chars()
796 l, long Copy-friendly, 14 characters, contains symbols.\n\ in wrapping_newline_chars()
797 m, med, medium Copy-friendly, 8 characters, contains symbols.\n", in wrapping_newline_chars()
799 utils::assert_output(cmd, "ctest --help", WRAPPING_NEWLINE_CHARS, false); in wrapping_newline_chars()
802 #[test]
810 l, long Copy-friendly, 14 characters, in wrapping_newline_variables()
812 m, med, medium Copy-friendly, 8 characters, in wrapping_newline_variables()
816 -h, --help Print help in wrapping_newline_variables()
817 -V, --version Print version in wrapping_newline_variables()
825 l, long Copy-friendly, 14 characters, contains symbols.{n}\ in wrapping_newline_variables()
826 m, med, medium Copy-friendly, 8 characters, contains symbols.{n}", in wrapping_newline_variables()
828 utils::assert_output(cmd, "ctest --help", WRAPPING_NEWLINE_CHARS, false); in wrapping_newline_variables()
831 #[test]
837 Arg::new("force-non-host") in dont_wrap_urls()
838 …oolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchai… in dont_wrap_urls()
839 .long("force-non-host") in dont_wrap_urls()
847 --force-non-host in dont_wrap_urls()
851 https://github.com/rust-lang/rustup/wiki/Non-host-toolchains in dont_wrap_urls()
852 -h, --help in dont_wrap_urls()
855 utils::assert_output(cmd, "Example update --help", EXPECTED, false); in dont_wrap_urls()
862 -m Some help with some wrapping
864 -h, --help Print help
865 -V, --version Print version
868 #[test]
876 utils::assert_output(cmd, "ctest --help", OLD_NEWLINE_CHARS, false); in old_newline_chars()
879 #[test]
887 utils::assert_output(cmd, "ctest --help", OLD_NEWLINE_CHARS, false); in old_newline_variables()
890 #[test]
897--filter <filter> Sets the filter, or sampling method, to use for interpolation when resizing the… in issue_688_hide_pos_vals()
900 -h, --help Print help in issue_688_hide_pos_vals()
901 -V, --version Print version in issue_688_hide_pos_vals()
916 utils::assert_output(app1, "ctest --help", ISSUE_688, false); in issue_688_hide_pos_vals()
927 utils::assert_output(app2, "ctest --help", ISSUE_688, false); in issue_688_hide_pos_vals()
937 utils::assert_output(app3, "ctest --help", ISSUE_688, false); in issue_688_hide_pos_vals()
940 #[test]
952 -s, --some <some> some option in issue_702_multiple_values()
953 -o, --other <other> some other option in issue_702_multiple_values()
954 -l, --label <label>... a label in issue_702_multiple_values()
955 -h, --help Print help in issue_702_multiple_values()
956 -V, --version Print version in issue_702_multiple_values()
992 utils::assert_output(cmd, "myapp --help", ISSUE_702, false); in issue_702_multiple_values()
995 #[test]
1009 -h, --help in long_about()
1010 Print help (see a summary with '-h') in long_about()
1012 -V, --version in long_about()
1024 utils::assert_output(cmd, "myapp --help", LONG_ABOUT, false); in long_about()
1027 #[test]
1031 rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...] in ripgrep_usage()
1032 rg [OPTIONS] --files [<path> ...] in ripgrep_usage()
1033 rg [OPTIONS] --type-list in ripgrep_usage()
1036 -h, --help Print help in ripgrep_usage()
1037 -V, --version Print version in ripgrep_usage()
1042 rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...] in ripgrep_usage()
1043 rg [OPTIONS] --files [<path> ...] in ripgrep_usage()
1044 rg [OPTIONS] --type-list", in ripgrep_usage()
1047 utils::assert_output(cmd, "rg --help", RIPGREP_USAGE, false); in ripgrep_usage()
1050 #[test]
1056 rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...] in ripgrep_usage_using_templates()
1057 rg [OPTIONS] --files [<path> ...] in ripgrep_usage_using_templates()
1058 rg [OPTIONS] --type-list in ripgrep_usage_using_templates()
1061 -h, --help Print help in ripgrep_usage_using_templates()
1062 -V, --version Print version in ripgrep_usage_using_templates()
1065 #[cfg(not(feature = "unstable-v5"))] in ripgrep_usage_using_templates()
1071 rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...] in ripgrep_usage_using_templates()
1072 rg [OPTIONS] --files [<path> ...] in ripgrep_usage_using_templates()
1073 rg [OPTIONS] --type-list", in ripgrep_usage_using_templates()
1085 #[cfg(feature = "unstable-v5")] in ripgrep_usage_using_templates()
1091 rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...] in ripgrep_usage_using_templates()
1092 rg [OPTIONS] --files [<path> ...] in ripgrep_usage_using_templates()
1093 rg [OPTIONS] --type-list", in ripgrep_usage_using_templates()
1105 utils::assert_output(cmd, "rg --help", RIPGREP_USAGE, false); in ripgrep_usage_using_templates()
1108 #[test]
1111 Usage: prog --opt <FILE> [PATH] in sc_negates_reqs()
1115 test in sc_negates_reqs()
1122 -o, --opt <FILE> tests options in sc_negates_reqs()
1123 -h, --help Print help in sc_negates_reqs()
1124 -V, --version Print version in sc_negates_reqs()
1130 .arg(arg!(-o --opt <FILE> "tests options").required(true)) in sc_negates_reqs()
1132 .subcommand(Command::new("test")); in sc_negates_reqs()
1133 utils::assert_output(cmd, "prog --help", SC_NEGATES_REQS, false); in sc_negates_reqs()
1136 #[test]
1142 -f, --flag testing flags in hide_args()
1143 -o, --opt <FILE> tests options in hide_args()
1144 -h, --help Print help in hide_args()
1145 -V, --version Print version in hide_args()
1150 .arg(arg!(-f --flag "testing flags")) in hide_args()
1151 .arg(arg!(-o --opt <FILE> "tests options")) in hide_args()
1153 utils::assert_output(cmd, "prog --help", HIDDEN_ARGS, false); in hide_args()
1156 #[test]
1163 test in args_negate_sc()
1170 -f, --flag testing flags in args_negate_sc()
1171 -o, --opt <FILE> tests options in args_negate_sc()
1172 -h, --help Print help in args_negate_sc()
1173 -V, --version Print version in args_negate_sc()
1179 .arg(arg!(-f --flag "testing flags")) in args_negate_sc()
1180 .arg(arg!(-o --opt <FILE> "tests options")) in args_negate_sc()
1182 .subcommand(Command::new("test")); in args_negate_sc()
1183 utils::assert_output(cmd, "prog --help", ARGS_NEGATE_SC, false); in args_negate_sc()
1186 #[test]
1195 -f, --flag testing flags in issue_1046_hide_scs()
1196 -o, --opt <FILE> tests options in issue_1046_hide_scs()
1197 -h, --help Print help in issue_1046_hide_scs()
1198 -V, --version Print version in issue_1046_hide_scs()
1203 .arg(arg!(-f --flag "testing flags")) in issue_1046_hide_scs()
1204 .arg(arg!(-o --opt <FILE> "tests options")) in issue_1046_hide_scs()
1206 .subcommand(Command::new("test").hide(true)); in issue_1046_hide_scs()
1207 utils::assert_output(cmd, "prog --help", ISSUE_1046_HIDDEN_SCS, false); in issue_1046_hide_scs()
1210 #[test]
1223 -h, --help Print help in issue_777_wrap_all_things()
1224 -V, --version Print version in issue_777_wrap_all_things()
1231 .help_template(utils::FULL_TEMPLATE) in issue_777_wrap_all_things()
1233 utils::assert_output(cmd, "ctest --help", ISSUE_777, false); in issue_777_wrap_all_things()
1237 Usage: test
1240 -H, --help Print help
1241 -V, --version Print version
1244 #[test]
1246 let cmd = Command::new("test") in override_help_short()
1248 .arg(arg!(-H --help "Print help").action(ArgAction::Help)) in override_help_short()
1251 utils::assert_output(cmd.clone(), "test --help", OVERRIDE_HELP_SHORT, false); in override_help_short()
1252 utils::assert_output(cmd, "test -H", OVERRIDE_HELP_SHORT, false); in override_help_short()
1256 Usage: test [OPTIONS]
1259 -h, --hell Print help
1260 -V, --version Print version
1263 #[test]
1265 let cmd = Command::new("test") in override_help_long()
1267 .arg(arg!(-h --hell "Print help").action(ArgAction::Help)) in override_help_long()
1270 utils::assert_output(cmd.clone(), "test --hell", OVERRIDE_HELP_LONG, false); in override_help_long()
1271 utils::assert_output(cmd, "test -h", OVERRIDE_HELP_LONG, false); in override_help_long()
1275 Usage: test
1278 -h, --help Print custom help information
1279 -V, --version Print version
1282 #[test]
1284 let cmd = Command::new("test") in override_help_about()
1286 .arg(arg!(-h --help "Print custom help information").action(ArgAction::Help)) in override_help_about()
1289 utils::assert_output(cmd.clone(), "test --help", OVERRIDE_HELP_ABOUT, false); in override_help_about()
1290 utils::assert_output(cmd, "test -h", OVERRIDE_HELP_ABOUT, false); in override_help_about()
1293 #[test]
1295 … one argument or group (call `cmd.disable_help_flag(true)` to remove the auto-generated `--help`)"]
1302 #[test]
1304 …r each argument, but '-h' is in use by both 'home' and 'help' (call `cmd.disable_help_flag(true)` …
1311 #[test]
1313 …h argument, but '--help' is in use by both 'custom-help' and 'help' (call `cmd.disable_help_flag(t…
1317 Arg::new("custom-help") in arg_long_conflict_with_help()
1324 #[test]
1327 Usage: last <TARGET> [CORPUS] [-- <ARGS>...] in last_arg_mult_usage()
1335 -h, --help Print help in last_arg_mult_usage()
1336 -V, --version Print version in last_arg_mult_usage()
1350 utils::assert_output(cmd, "last --help", LAST_ARG, false); in last_arg_mult_usage()
1353 #[test]
1356 Usage: last <TARGET> [CORPUS] -- <ARGS>... in last_arg_mult_usage_req()
1364 -h, --help Print help in last_arg_mult_usage_req()
1365 -V, --version Print version in last_arg_mult_usage_req()
1380 utils::assert_output(cmd, "last --help", LAST_ARG_REQ, false); in last_arg_mult_usage_req()
1383 #[test]
1386 Usage: last <TARGET> [CORPUS] -- <ARGS>... in last_arg_mult_usage_req_with_sc()
1390 test some in last_arg_mult_usage_req_with_sc()
1399 -h, --help Print help in last_arg_mult_usage_req_with_sc()
1400 -V, --version Print version in last_arg_mult_usage_req_with_sc()
1416 .subcommand(Command::new("test").about("some")); in last_arg_mult_usage_req_with_sc()
1417 utils::assert_output(cmd, "last --help", LAST_ARG_REQ_SC, false); in last_arg_mult_usage_req_with_sc()
1420 #[test]
1423 Usage: last <TARGET> [CORPUS] [-- <ARGS>...] in last_arg_mult_usage_with_sc()
1427 test some in last_arg_mult_usage_with_sc()
1436 -h, --help Print help in last_arg_mult_usage_with_sc()
1437 -V, --version Print version in last_arg_mult_usage_with_sc()
1452 .subcommand(Command::new("test").about("some")); in last_arg_mult_usage_with_sc()
1453 utils::assert_output(cmd, "last --help", LAST_ARG_SC, false); in last_arg_mult_usage_with_sc()
1460 --arg <argument> Pass an argument to the program. [default: default-argument]
1461 -h, --help Print help
1462 -V, --version Print version
1465 #[test]
1469 .help("Pass an argument to the program. [default: default-argument]") in hide_default_val()
1471 .default_value("default-argument") in hide_default_val()
1474 utils::assert_output(app1, "default --help", HIDE_DEFAULT_VAL, false); in hide_default_val()
1480 .default_value("default-argument"), in hide_default_val()
1482 utils::assert_output(app2, "default --help", HIDE_DEFAULT_VAL, false); in hide_default_val()
1485 #[test]
1492--arg <argument> Pass an argument to the program. [default: \"\\n\"] [possible values: normal, \"… in escaped_whitespace_values()
1494 -h, --help Print help in escaped_whitespace_values()
1495 -V, --version Print version in escaped_whitespace_values()
1505 utils::assert_output(app1, "default --help", ESCAPED_DEFAULT_VAL, false); in escaped_whitespace_values()
1508 fn issue_1112_setup() -> Command { in issue_1112_setup()
1509 Command::new("test") in issue_1112_setup()
1530 #[test]
1532 let m = issue_1112_setup().try_get_matches_from(vec!["test", "--help"]); in prefer_user_help_long_1112()
1539 #[test]
1541 let m = issue_1112_setup().try_get_matches_from(vec!["test", "-h"]); in prefer_user_help_short_1112()
1548 #[test]
1550 let m = issue_1112_setup().try_get_matches_from(vec!["test", "foo", "--help"]); in prefer_user_subcmd_help_long_1112()
1561 #[test]
1563 let m = issue_1112_setup().try_get_matches_from(vec!["test", "foo", "-h"]); in prefer_user_subcmd_help_short_1112()
1574 #[test]
1579 Usage: test --fake <some> <val> in issue_1052_require_delim_help()
1582 -f, --fake <some> <val> some help in issue_1052_require_delim_help()
1583 -h, --help Print help in issue_1052_require_delim_help()
1584 -V, --version Print version in issue_1052_require_delim_help()
1587 let cmd = Command::new("test") in issue_1052_require_delim_help()
1592 arg!(-f --fake <s> "some help") in issue_1052_require_delim_help()
1599 utils::assert_output(cmd, "test --help", REQUIRE_DELIM_HELP, false); in issue_1052_require_delim_help()
1602 #[test]
1607 Usage: test [OPTIONS] --fake <some> <val> in custom_headers_headers()
1610 -f, --fake <some> <val> some help in custom_headers_headers()
1611 -h, --help Print help in custom_headers_headers()
1612 -V, --version Print version in custom_headers_headers()
1615 -n, --no-proxy Do not use system proxy settings in custom_headers_headers()
1616 --port in custom_headers_headers()
1624 arg!(-f --fake <s> "some help") in custom_headers_headers()
1632 Arg::new("no-proxy") in custom_headers_headers()
1634 .long("no-proxy") in custom_headers_headers()
1640 utils::assert_output(cmd, "test --help", CUSTOM_HELP_SECTION, false); in custom_headers_headers()
1646 Usage: test [OPTIONS] --fake <some> <val> --birthday-song <song> --birthday-song-volume <volume>
1649 -f, --fake <some> <val> some help
1650 --style <style> Choose musical style to play the song
1651 -s, --speed <SPEED> How fast? [possible values: fast, slow]
1652 -h, --help Print help
1653 -V, --version Print version
1656 -n, --no-proxy Do not use system proxy settings
1657 -a, --server-addr Set server address
1660 -b, --birthday-song <song> Change which song is played for birthdays
1663 -v, --birthday-song-volume <volume> Change the volume of the birthday song
1666 #[test]
1673 arg!(-f --fake <s> "some help") in multiple_custom_help_headers()
1681 Arg::new("no-proxy") in multiple_custom_help_headers()
1683 .long("no-proxy") in multiple_custom_help_headers()
1689 arg!(-b --"birthday-song" <song> "Change which song is played for birthdays") in multiple_custom_help_headers()
1693 .arg(arg!(--style <style> "Choose musical style to play the song").help_heading(None)) in multiple_custom_help_headers()
1696 -v --"birthday-song-volume" <volume> "Change the volume of the birthday song" in multiple_custom_help_headers()
1702 Arg::new("server-addr") in multiple_custom_help_headers()
1704 .long("server-addr") in multiple_custom_help_headers()
1719 utils::assert_output(cmd, "test --help", MULTIPLE_CUSTOM_HELP_SECTIONS, false); in multiple_custom_help_headers()
1725 Usage: test [OPTIONS] --song <song> --song-volume <volume>
1728 -h, --help Print help (see more with '--help')
1729 -V, --version Print version
1732 -b, --song <song> Change which song is played for birthdays
1735 -v, --song-volume <volume> Change the volume of the birthday song
1738 #[test]
1746 Arg::new("no-proxy") in custom_help_headers_hide_args()
1748 .long("no-proxy") in custom_help_headers_hide_args()
1754 arg!(-b --song <song> "Change which song is played for birthdays") in custom_help_headers_hide_args()
1760 -v --"song-volume" <volume> "Change the volume of the birthday song" in custom_help_headers_hide_args()
1766 Arg::new("server-addr") in custom_help_headers_hide_args()
1768 .long("server-addr") in custom_help_headers_hide_args()
1774 utils::assert_output(cmd, "test -h", CUSTOM_HELP_SECTION_HIDDEN_ARGS, false); in custom_help_headers_hide_args()
1783 -h, --help
1784 Print help (see a summary with '-h')
1786 -V, --version
1790 #[test]
1798 utils::assert_output(cmd, "ctest foo --help", ISSUE_897, false); in show_long_about_issue_897()
1807 -h, --help Print help (see more with '--help')
1808 -V, --version Print version
1811 #[test]
1819 utils::assert_output(cmd, "ctest foo -h", ISSUE_897_SHORT, false); in show_short_about_issue_897()
1822 #[test]
1831 -f in issue_1364_no_short_options()
1832 -h, --help Print help (see more with '--help') in issue_1364_no_short_options()
1850 utils::assert_output(cmd, "demo -h", ISSUE_1364, false); in issue_1364_no_short_options()
1854 #[test]
1864 -h, --help Print help in issue_1487()
1867 let cmd = Command::new("test") in issue_1487()
1875 utils::assert_output(cmd, "ctest -h", ISSUE_1487, false); in issue_1487()
1879 #[test]
1890 #[test]
1901 #[test]
1912 #[test]
1928 #[test]
1943 #[test]
1957 #[test]
1966 #[test]
1974 #[test]
1980 --config in issue_1642_long_help_spacing()
1986 -h, --help in issue_1642_long_help_spacing()
1987 Print help (see a summary with '-h') in issue_1642_long_help_spacing()
2001 utils::assert_output(cmd, "prog --help", ISSUE_1642, false); in issue_1642_long_help_spacing()
2010 #[test]
2023 #[test]
2037 utils::assert_output(cmd.clone(), "myapp help help", HELP_SUBCMD_HELP, false); in help_subcmd_help()
2040 #[test]
2054 utils::assert_output( in subcmd_help_subcmd_help()
2062 #[test]
2072 -g, --some-global <someglobal>\x20\x20 in global_args_should_show_on_toplevel_help_message()
2073 -h, --help Print help in global_args_should_show_on_toplevel_help_message()
2080 .long("some-global") in global_args_should_show_on_toplevel_help_message()
2085 utils::assert_output(cmd, "myapp help", HELP, false); in global_args_should_show_on_toplevel_help_message()
2088 #[test]
2103 .long("some-global") in global_args_should_not_show_on_help_message_for_help_help()
2108 utils::assert_output(cmd, "myapp help help", HELP_HELP, false); in global_args_should_not_show_on_help_message_for_help_help()
2111 #[test]
2121 -g, --some-global <someglobal>\x20\x20 in global_args_should_show_on_help_message_for_subcommand()
2122 -h, --help Print help in global_args_should_show_on_help_message_for_subcommand()
2129 .long("some-global") in global_args_should_show_on_help_message_for_subcommand()
2134 utils::assert_output(cmd, "myapp help subcmd", HELP_SUBCMD, false); in global_args_should_show_on_help_message_for_subcommand()
2137 #[test]
2143 -g, --some-global <someglobal>\x20\x20 in global_args_should_show_on_help_message_for_nested_subcommand()
2144 -h, --help Print help in global_args_should_show_on_help_message_for_nested_subcommand()
2145 -V, --version Print version in global_args_should_show_on_help_message_for_nested_subcommand()
2152 .long("some-global") in global_args_should_show_on_help_message_for_nested_subcommand()
2157 utils::assert_output(cmd, "myapp help subcmd multi", HELP_SUB_SUBCMD, false); in global_args_should_show_on_help_message_for_nested_subcommand()
2160 #[test]
2166 -a in option_usage_order()
2167 -B in option_usage_order()
2168 -b in option_usage_order()
2169 -s in option_usage_order()
2170 --select_file in option_usage_order()
2171 --select_folder in option_usage_order()
2172 -x in option_usage_order()
2173 -h, --help Print help in option_usage_order()
2190 utils::assert_output(cmd, "order --help", OPTION_USAGE_ORDER, false); in option_usage_order()
2193 #[test]
2196 Usage: about-in-subcommands-list [COMMAND] in prefer_about_over_long_about_in_subcommands_list()
2203 -h, --help Print help in prefer_about_over_long_about_in_subcommands_list()
2206 let cmd = Command::new("about-in-subcommands-list").subcommand( in prefer_about_over_long_about_in_subcommands_list()
2212 utils::assert_output( in prefer_about_over_long_about_in_subcommands_list()
2214 "about-in-subcommands-list --help", in prefer_about_over_long_about_in_subcommands_list()
2220 #[test]
2223 Usage: deno <pos1|--option1> [pos2] in issue_1794_usage()
2230 --option1 in issue_1794_usage()
2231 -h, --help Print help in issue_1794_usage()
2249 utils::assert_output(cmd, "deno --help", USAGE_WITH_GROUP, false); in issue_1794_usage()
2253 Usage: test [gear] [speed]
2259 -h, --help Print help
2260 -V, --version Print version
2266 #[test]
2268 let cmd = Command::new("test") in custom_heading_pos()
2274 utils::assert_output(cmd, "test --help", CUSTOM_HEADING_POS, false); in custom_heading_pos()
2278 Usage: test [OPTIONS]
2281 -s, --speed <SPEED> How fast
2284 #[test]
2286 let cmd = Command::new("test") in only_custom_heading_opts_no_args()
2290 .arg(arg!(--help).action(ArgAction::Help).hide(true)) in only_custom_heading_opts_no_args()
2292 .arg(arg!(-s --speed <SPEED> "How fast")); in only_custom_heading_opts_no_args()
2294 utils::assert_output(cmd, "test --help", ONLY_CUSTOM_HEADING_OPTS_NO_ARGS, false); in only_custom_heading_opts_no_args()
2298 Usage: test [speed]
2304 #[test]
2306 let cmd = Command::new("test") in only_custom_heading_pos_no_args()
2310 .arg(arg!(--help).action(ArgAction::Help).hide(true)) in only_custom_heading_pos_no_args()
2314 utils::assert_output(cmd, "test --help", ONLY_CUSTOM_HEADING_POS_NO_ARGS, false); in only_custom_heading_pos_no_args()
2317 #[test]
2327 utils::assert_output( in issue_2508_number_of_values_with_single_value_name()
2329 "my_app --help", in issue_2508_number_of_values_with_single_value_name()
2334 --some_arg <some_arg> <some_arg> in issue_2508_number_of_values_with_single_value_name()
2335 --some_arg_issue <ARG> <ARG> in issue_2508_number_of_values_with_single_value_name()
2336 -h, --help Print help in issue_2508_number_of_values_with_single_value_name()
2342 #[test]
2344 let cmd = Command::new("test") in missing_positional_final_required()
2348 utils::assert_output( in missing_positional_final_required()
2350 "test --help", in missing_positional_final_required()
2352 Usage: test [arg1] <arg2> in missing_positional_final_required()
2359 -h, --help Print help in missing_positional_final_required()
2365 #[test]
2367 let cmd = Command::new("test") in missing_positional_final_multiple()
2372 utils::assert_output( in missing_positional_final_multiple()
2374 "test --help", in missing_positional_final_multiple()
2376 Usage: test [foo] [bar] [baz]... in missing_positional_final_multiple()
2384 -h, --help Print help in missing_positional_final_multiple()
2390 #[test]
2392 let cmd = Command::new("test").arg( in positional_multiple_values_is_dotted()
2398 utils::assert_output( in positional_multiple_values_is_dotted()
2400 "test --help", in positional_multiple_values_is_dotted()
2402 Usage: test <foo>... in positional_multiple_values_is_dotted()
2408 -h, --help Print help in positional_multiple_values_is_dotted()
2413 let cmd = Command::new("test").arg( in positional_multiple_values_is_dotted()
2420 utils::assert_output( in positional_multiple_values_is_dotted()
2422 "test --help", in positional_multiple_values_is_dotted()
2424 Usage: test <BAR>... in positional_multiple_values_is_dotted()
2430 -h, --help Print help in positional_multiple_values_is_dotted()
2436 #[test]
2438 let cmd = Command::new("test").arg( in positional_multiple_occurrences_is_dotted()
2445 utils::assert_output( in positional_multiple_occurrences_is_dotted()
2447 "test --help", in positional_multiple_occurrences_is_dotted()
2449 Usage: test <foo>... in positional_multiple_occurrences_is_dotted()
2455 -h, --help Print help in positional_multiple_occurrences_is_dotted()
2460 let cmd = Command::new("test").arg( in positional_multiple_occurrences_is_dotted()
2468 utils::assert_output( in positional_multiple_occurrences_is_dotted()
2470 "test --help", in positional_multiple_occurrences_is_dotted()
2472 Usage: test <BAR>... in positional_multiple_occurrences_is_dotted()
2478 -h, --help Print help in positional_multiple_occurrences_is_dotted()
2484 #[test]
2486 let cmd = Command::new("test").arg( in too_few_value_names_is_dotted()
2494 utils::assert_output( in too_few_value_names_is_dotted()
2496 "test --help", in too_few_value_names_is_dotted()
2498 Usage: test --foo <one> <two>... in too_few_value_names_is_dotted()
2501 --foo <one> <two>... in too_few_value_names_is_dotted()
2502 -h, --help Print help in too_few_value_names_is_dotted()
2508 #[test]
2511 Command::new("test") in too_many_value_names_panics()
2523 #[test]
2534 #[test]
2551 #[test]
2568 #[test]
2574 let matches = cmd.try_get_matches_from(["foo", "--help"]).unwrap(); in override_help_flag_using_long()
2578 #[test]
2584 let matches = cmd.try_get_matches_from(["foo", "-h"]).unwrap(); in override_help_flag_using_short()
2588 #[test]
2590 // The main care-about is that the docs and behavior match. Since the `help` subcommand in subcommand_help_doesnt_have_useless_help_flag()
2591 // currently ignores the `--help` flag, the output shouldn't have it. in subcommand_help_doesnt_have_useless_help_flag()
2592 let cmd = Command::new("example").subcommand(Command::new("test").about("Subcommand")); in subcommand_help_doesnt_have_useless_help_flag()
2594 utils::assert_output( in subcommand_help_doesnt_have_useless_help_flag()
2609 #[test]
2613 .subcommand(Command::new("test").about("Subcommand")); in disable_help_flag_affects_help_subcommand()
2629 #[test]
2636 utils::assert_output( in dont_propagate_version_to_help_subcommand()
2653 #[test]
2655 let mut cmd = clap::Command::new("test") in help_without_short()
2656 .arg(arg!(-h --hex <NUM>).required(true)) in help_without_short()
2657 .arg(arg!(--help).action(ArgAction::Help)) in help_without_short()
2664 let m = cmd.try_get_matches_from(["test", "-h", "0x100"]).unwrap(); in help_without_short()
2671 #[test]
2676 Usage: parent <TARGET> <ARGS> test in parent_cmd_req_in_usage_with_help_flag()
2679 -h, --help Print help in parent_cmd_req_in_usage_with_help_flag()
2690 .subcommand(Command::new("test").about("some")); in parent_cmd_req_in_usage_with_help_flag()
2691 utils::assert_output(cmd, "parent test --help", EXPECTED, false); in parent_cmd_req_in_usage_with_help_flag()
2694 #[test]
2699 Usage: parent <TARGET> <ARGS> test in parent_cmd_req_in_usage_with_help_subcommand()
2702 -h, --help Print help in parent_cmd_req_in_usage_with_help_subcommand()
2713 .subcommand(Command::new("test").about("some")); in parent_cmd_req_in_usage_with_help_subcommand()
2714 utils::assert_output(cmd, "parent help test", EXPECTED, false); in parent_cmd_req_in_usage_with_help_subcommand()
2717 #[test]
2722 Usage: parent <TARGET> <ARGS> test in parent_cmd_req_in_usage_with_render_help()
2725 -h, --help Print help in parent_cmd_req_in_usage_with_render_help()
2736 .subcommand(Command::new("test").about("some")); in parent_cmd_req_in_usage_with_render_help()
2738 let subcmd = cmd.find_subcommand_mut("test").unwrap(); in parent_cmd_req_in_usage_with_render_help()
2741 utils::assert_eq(EXPECTED, help); in parent_cmd_req_in_usage_with_render_help()
2744 #[test]
2750 -h, --help Print help in parent_cmd_req_ignored_when_negates_reqs()
2757 utils::assert_output(cmd, "ctest subcmd --help", MULTI_SC_HELP, false); in parent_cmd_req_ignored_when_negates_reqs()
2760 #[test]
2766 -h, --help Print help in parent_cmd_req_ignored_when_conflicts()
2773 utils::assert_output(cmd, "ctest subcmd --help", MULTI_SC_HELP, false); in parent_cmd_req_ignored_when_conflicts()
2776 #[test]
2781 utils::assert_output(cmd, "ctest --help", MULTI_SC_HELP, false); in no_wrap_help()
2784 #[test]
2791 #[test]
2800 #[test]
2806 Some("parent-child") in display_name_subcommand_default()
2810 #[test]