• Home
  • Raw
  • Download

Lines Matching refs:new

8     Command::new("test")  in setup()
46 Command::new("test") in help_subcommand()
59 let cmd = Command::new("ctest").subcommand( in help_multi_subcommand_error()
60 Command::new("subcmd").subcommand( in help_multi_subcommand_error()
61 Command::new("multi") in help_multi_subcommand_error()
105 let cmd = Command::new("example") in req_last_arg_usage()
107 .arg(Arg::new("FIRST").help("First").num_args(1..).required(true)) in req_last_arg_usage()
109 Arg::new("SECOND") in req_last_arg_usage()
135 let cmd = Command::new("flamegraph") in args_with_last_usage()
138 Arg::new("verbose") in args_with_last_usage()
145 Arg::new("timeout") in args_with_last_usage()
152 Arg::new("frequency") in args_with_last_usage()
159 Arg::new("binary path") in args_with_last_usage()
164 Arg::new("pass through args") in args_with_last_usage()
250 let cmd = Command::new("clap-test") in after_and_before_help_output()
290 let cmd = Command::new("clap-test") in after_and_before_long_help_output()
315 let cmd = Command::new("ctest").subcommand( in multi_level_sc_help()
316 Command::new("subcmd").subcommand( in multi_level_sc_help()
317 Command::new("multi") in multi_level_sc_help()
347 let cmd = Command::new("ctest").version("1.0").term_width(0); in no_wrap_default_help()
367 let cmd = Command::new("test") in wrapped_help()
370 Arg::new("all") in wrapped_help()
377 Arg::new("exact") in wrapped_help()
383 Arg::new("no_git_commit") in wrapped_help()
389 Arg::new("no_git_push") in wrapped_help()
413 let cmd = Command::new("test") in unwrapped_help()
416 Arg::new("all") in unwrapped_help()
423 Arg::new("exact") in unwrapped_help()
429 Arg::new("no_git_commit") in unwrapped_help()
435 Arg::new("no_git_push") in unwrapped_help()
472 let cmd = Command::new("test") in possible_value_wrapped_help()
475 Arg::new("possible_values") in possible_value_wrapped_help()
479 PossibleValue::new("short_name") in possible_value_wrapped_help()
481 PossibleValue::new("second").help("Short help gets handled the same"), in possible_value_wrapped_help()
485 Arg::new("possible_values_with_new_line") in possible_value_wrapped_help()
489 PossibleValue::new("long enough name to trigger new line").help( in possible_value_wrapped_help()
492 PossibleValue::new("second"), in possible_value_wrapped_help()
496 Arg::new("possible_values_without_new_line") in possible_value_wrapped_help()
500 PossibleValue::new("name").help("Short enough help message with no wrapping"), in possible_value_wrapped_help()
501 PossibleValue::new("second").help("short help"), in possible_value_wrapped_help()
549 let cmd = Command::new("ctest").version("0.1").term_width(70).arg( in issue_626_unicode_cutoff()
550 Arg::new("cafe") in issue_626_unicode_cutoff()
579 let cmd = Command::new("ctest") in hide_possible_vals()
582 Arg::new("pos") in hide_possible_vals()
591 Arg::new("cafe") in hide_possible_vals()
605 let cmd = Command::new("ctest") in hide_single_possible_val()
608 Arg::new("pos") in hide_single_possible_val()
615 PossibleValue::new("secret speed").hide(true), in hide_single_possible_val()
621 Arg::new("cafe") in hide_single_possible_val()
653 let app = Command::new("ctest") in possible_vals_with_help()
656 Arg::new("pos") in possible_vals_with_help()
661 PossibleValue::new("fast"), in possible_vals_with_help()
662 PossibleValue::new("slow").help("not as fast"), in possible_vals_with_help()
663 PossibleValue::new("secret speed").hide(true), in possible_vals_with_help()
669 Arg::new("cafe") in possible_vals_with_help()
700 let cmd = Command::new("ctest") in issue_626_panic()
703 .arg(Arg::new("cafe") in issue_626_panic()
718 let _ = Command::new("ctest") in issue_626_variable_panic()
721 .arg(Arg::new("cafe") in issue_626_variable_panic()
746 let cmd = Command::new("ctest").version("0.1").term_width(24); in final_word_wrapping()
768 let cmd = Command::new("ctest") in wrapping_newline_chars()
771 .arg(Arg::new("mode").help( in wrapping_newline_chars()
797 let cmd = Command::new("ctest") in wrapping_newline_variables()
800 .arg(Arg::new("mode").help( in wrapping_newline_variables()
811 let cmd = Command::new("Example") in dont_wrap_urls()
813 .subcommand(Command::new("update").arg( in dont_wrap_urls()
814 Arg::new("force-non-host") in dont_wrap_urls()
847 let cmd = Command::new("ctest").version("0.1").arg( in old_newline_chars()
848 Arg::new("mode") in old_newline_chars()
858 let cmd = Command::new("ctest").version("0.1").arg( in old_newline_variables()
859 Arg::new("mode") in old_newline_variables()
883 let app1 = Command::new("ctest") in issue_688_hide_pos_vals()
887 .arg(Arg::new("filter") in issue_688_hide_pos_vals()
895 let app2 = Command::new("ctest") in issue_688_hide_pos_vals()
898 .arg(Arg::new("filter") in issue_688_hide_pos_vals()
906 let app3 = Command::new("ctest") in issue_688_hide_pos_vals()
909 .arg(Arg::new("filter") in issue_688_hide_pos_vals()
936 let cmd = Command::new("myapp") in issue_702_multiple_values()
940 .arg(Arg::new("arg1").help("some option")) in issue_702_multiple_values()
942 Arg::new("arg2") in issue_702_multiple_values()
948 Arg::new("some") in issue_702_multiple_values()
955 Arg::new("other") in issue_702_multiple_values()
962 Arg::new("label") in issue_702_multiple_values()
993 let cmd = Command::new("myapp") in long_about()
1000 .arg(Arg::new("arg1").help("some option")); in long_about()
1017 let cmd = Command::new("ripgrep").version("0.5").override_usage( in ripgrep_usage()
1043 let cmd = Command::new("ripgrep") in ripgrep_usage_using_templates()
1063 let cmd = Command::new("ripgrep") in ripgrep_usage_using_templates()
1104 let cmd = Command::new("prog") in sc_negates_reqs()
1108 .arg(Arg::new("PATH").help("help")) in sc_negates_reqs()
1109 .subcommand(Command::new("test")); in sc_negates_reqs()
1125 let cmd = Command::new("prog") in hide_args()
1129 .arg(Arg::new("pos").hide(true)); in hide_args()
1153 let cmd = Command::new("prog") in args_negate_sc()
1158 .arg(Arg::new("PATH").help("help")) in args_negate_sc()
1159 .subcommand(Command::new("test")); in args_negate_sc()
1178 let cmd = Command::new("prog") in issue_1046_hide_scs()
1182 .arg(Arg::new("PATH").help("some")) in issue_1046_hide_scs()
1183 .subcommand(Command::new("test").hide(true)); in issue_1046_hide_scs()
1204 let cmd = Command::new("A cmd with a crazy very long long long name hahaha") in issue_777_wrap_all_things()
1223 let cmd = Command::new("test") in override_help_short()
1242 let cmd = Command::new("test") in override_help_long()
1261 let cmd = Command::new("test") in override_help_about()
1274 Command::new("conflict") in arg_id_conflict_with_help()
1275 .arg(Arg::new("help").short('?').action(ArgAction::SetTrue)) in arg_id_conflict_with_help()
1283 Command::new("conflict") in arg_short_conflict_with_help()
1284 .arg(Arg::new("home").short('h').action(ArgAction::SetTrue)) in arg_short_conflict_with_help()
1292 Command::new("conflict") in arg_long_conflict_with_help()
1294 Arg::new("custom-help") in arg_long_conflict_with_help()
1316 let cmd = Command::new("last") in last_arg_mult_usage()
1318 .arg(Arg::new("TARGET").required(true).help("some")) in last_arg_mult_usage()
1319 .arg(Arg::new("CORPUS").help("some")) in last_arg_mult_usage()
1321 Arg::new("ARGS") in last_arg_mult_usage()
1345 let cmd = Command::new("last") in last_arg_mult_usage_req()
1347 .arg(Arg::new("TARGET").required(true).help("some")) in last_arg_mult_usage_req()
1348 .arg(Arg::new("CORPUS").help("some")) in last_arg_mult_usage_req()
1350 Arg::new("ARGS") in last_arg_mult_usage_req()
1380 let cmd = Command::new("last") in last_arg_mult_usage_req_with_sc()
1383 .arg(Arg::new("TARGET").required(true).help("some")) in last_arg_mult_usage_req_with_sc()
1384 .arg(Arg::new("CORPUS").help("some")) in last_arg_mult_usage_req_with_sc()
1386 Arg::new("ARGS") in last_arg_mult_usage_req_with_sc()
1393 .subcommand(Command::new("test").about("some")); in last_arg_mult_usage_req_with_sc()
1417 let cmd = Command::new("last") in last_arg_mult_usage_with_sc()
1420 .arg(Arg::new("TARGET").required(true).help("some")) in last_arg_mult_usage_with_sc()
1421 .arg(Arg::new("CORPUS").help("some")) in last_arg_mult_usage_with_sc()
1423 Arg::new("ARGS") in last_arg_mult_usage_with_sc()
1429 .subcommand(Command::new("test").about("some")); in last_arg_mult_usage_with_sc()
1444 let app1 = Command::new("default").version("0.1").term_width(120).arg( in hide_default_val()
1445 Arg::new("argument") in hide_default_val()
1453 let app2 = Command::new("default").version("0.1").term_width(120).arg( in hide_default_val()
1454 Arg::new("argument") in hide_default_val()
1475 let app1 = Command::new("default").version("0.1").term_width(120).arg( in escaped_whitespace_values()
1476 Arg::new("argument") in escaped_whitespace_values()
1486 Command::new("test") in issue_1112_setup()
1490 Arg::new("help1") in issue_1112_setup()
1497 Command::new("foo").arg( in issue_1112_setup()
1498 Arg::new("help1") in issue_1112_setup()
1564 let cmd = Command::new("test") in issue_1052_require_delim_help()
1596 let cmd = Command::new("blorp") in custom_headers_headers()
1609 Arg::new("no-proxy") in custom_headers_headers()
1615 .args([Arg::new("port").long("port").action(ArgAction::SetTrue)]); in custom_headers_headers()
1645 let cmd = Command::new("blorp") in multiple_custom_help_headers()
1658 Arg::new("no-proxy") in multiple_custom_help_headers()
1679 Arg::new("server-addr") in multiple_custom_help_headers()
1687 Arg::new("speed") in multiple_custom_help_headers()
1717 let cmd = Command::new("blorp") in custom_help_headers_hide_args()
1723 Arg::new("no-proxy") in custom_help_headers_hide_args()
1743 Arg::new("server-addr") in custom_help_headers_hide_args()
1769 let cmd = Command::new("ctest").version("0.1").subcommand( in show_long_about_issue_897()
1770 Command::new("foo") in show_long_about_issue_897()
1790 let cmd = Command::new("ctest").version("0.1").subcommand( in show_short_about_issue_897()
1791 Command::new("foo") in show_short_about_issue_897()
1812 let cmd = Command::new("demo") in issue_1364_no_short_options()
1813 .arg(Arg::new("foo").short('f').action(ArgAction::SetTrue)) in issue_1364_no_short_options()
1815 Arg::new("baz") in issue_1364_no_short_options()
1821 Arg::new("files") in issue_1364_no_short_options()
1844 let cmd = Command::new("test") in issue_1487()
1845 .arg(Arg::new("arg1") in issue_1487()
1847 .arg(Arg::new("arg2") in issue_1487()
1849 .group(ArgGroup::new("group1") in issue_1487()
1859 Command::new("myapp") in help_required_but_not_given()
1861 .arg(Arg::new("foo")) in help_required_but_not_given()
1870 Command::new("myapp") in help_required_but_not_given_settings_after_args()
1871 .arg(Arg::new("foo")) in help_required_but_not_given_settings_after_args()
1881 Command::new("myapp") in help_required_but_not_given_for_one_of_two_arguments()
1883 .arg(Arg::new("foo")) in help_required_but_not_given_for_one_of_two_arguments()
1884 .arg(Arg::new("bar").help("It does bar stuff")) in help_required_but_not_given_for_one_of_two_arguments()
1892 Command::new("myapp") in help_required_globally()
1894 .arg(Arg::new("foo").help("It does foo stuff")) in help_required_globally()
1896 Command::new("bar") in help_required_globally()
1897 .arg(Arg::new("create").help("creates bar")) in help_required_globally()
1898 .arg(Arg::new("delete")), in help_required_globally()
1908 Command::new("myapp") in help_required_globally_but_not_given_for_subcommand()
1910 .arg(Arg::new("foo").help("It does foo stuff")) in help_required_globally_but_not_given_for_subcommand()
1912 Command::new("bar") in help_required_globally_but_not_given_for_subcommand()
1913 .arg(Arg::new("create").help("creates bar")) in help_required_globally_but_not_given_for_subcommand()
1914 .arg(Arg::new("delete")), in help_required_globally_but_not_given_for_subcommand()
1922 Command::new("myapp") in help_required_and_given_for_subcommand()
1924 .arg(Arg::new("foo").help("It does foo stuff")) in help_required_and_given_for_subcommand()
1926 Command::new("bar") in help_required_and_given_for_subcommand()
1927 .arg(Arg::new("create").help("creates bar")) in help_required_and_given_for_subcommand()
1928 .arg(Arg::new("delete").help("deletes bar")), in help_required_and_given_for_subcommand()
1936 Command::new("myapp") in help_required_and_given()
1938 .arg(Arg::new("foo").help("It does foo stuff")) in help_required_and_given()
1945 Command::new("myapp") in help_required_and_no_args()
1967 let cmd = Command::new("prog").arg( in issue_1642_long_help_spacing()
1968 Arg::new("cfg") in issue_1642_long_help_spacing()
1989 let mut cmd = Command::new("myapp") in after_help_no_args()
2011 let cmd = Command::new("myapp") in help_subcmd_help()
2012 .subcommand(Command::new("subcmd").subcommand(Command::new("multi").version("1.0"))); in help_subcmd_help()
2028 let cmd = Command::new("myapp") in subcmd_help_subcmd_help()
2029 .subcommand(Command::new("subcmd").subcommand(Command::new("multi").version("1.0"))); in subcmd_help_subcmd_help()
2053 let cmd = Command::new("myapp") in global_args_should_show_on_toplevel_help_message()
2055 Arg::new("someglobal") in global_args_should_show_on_toplevel_help_message()
2060 .subcommand(Command::new("subcmd").subcommand(Command::new("multi").version("1.0"))); in global_args_should_show_on_toplevel_help_message()
2076 let cmd = Command::new("myapp") in global_args_should_not_show_on_help_message_for_help_help()
2078 Arg::new("someglobal") in global_args_should_not_show_on_help_message_for_help_help()
2083 .subcommand(Command::new("subcmd").subcommand(Command::new("multi").version("1.0"))); in global_args_should_not_show_on_help_message_for_help_help()
2102 let cmd = Command::new("myapp") in global_args_should_show_on_help_message_for_subcommand()
2104 Arg::new("someglobal") in global_args_should_show_on_help_message_for_subcommand()
2109 .subcommand(Command::new("subcmd").subcommand(Command::new("multi").version("1.0"))); in global_args_should_show_on_help_message_for_subcommand()
2125 let cmd = Command::new("myapp") in global_args_should_show_on_help_message_for_nested_subcommand()
2127 Arg::new("someglobal") in global_args_should_show_on_help_message_for_nested_subcommand()
2132 .subcommand(Command::new("subcmd").subcommand(Command::new("multi").version("1.0"))); in global_args_should_show_on_help_message_for_nested_subcommand()
2153 let cmd = Command::new("order").args([ in option_usage_order()
2154 Arg::new("a").short('a').action(ArgAction::SetTrue), in option_usage_order()
2155 Arg::new("B").short('B').action(ArgAction::SetTrue), in option_usage_order()
2156 Arg::new("b").short('b').action(ArgAction::SetTrue), in option_usage_order()
2157 Arg::new("save").short('s').action(ArgAction::SetTrue), in option_usage_order()
2158 Arg::new("select_file") in option_usage_order()
2161 Arg::new("select_folder") in option_usage_order()
2164 Arg::new("x").short('x').action(ArgAction::SetTrue), in option_usage_order()
2183 let cmd = Command::new("about-in-subcommands-list").subcommand( in prefer_about_over_long_about_in_subcommands_list()
2184 Command::new("sub") in prefer_about_over_long_about_in_subcommands_list()
2211 let cmd = clap::Command::new("hello") in issue_1794_usage()
2214 Arg::new("option1") in issue_1794_usage()
2218 .arg(Arg::new("pos1").action(ArgAction::Set)) in issue_1794_usage()
2220 ArgGroup::new("arg1") in issue_1794_usage()
2224 .arg(Arg::new("pos2").action(ArgAction::Set)); in issue_1794_usage()
2245 let cmd = Command::new("test") in custom_heading_pos()
2247 .arg(Arg::new("gear").help("Which gear")) in custom_heading_pos()
2249 .arg(Arg::new("speed").help("How fast")); in custom_heading_pos()
2263 let cmd = Command::new("test") in only_custom_heading_opts_no_args()
2283 let cmd = Command::new("test") in only_custom_heading_pos_no_args()
2289 .arg(Arg::new("speed").help("How fast")); in only_custom_heading_pos_no_args()
2296 let cmd = Command::new("my_app") in issue_2508_number_of_values_with_single_value_name()
2297 .arg(Arg::new("some_arg").long("some_arg").num_args(2)) in issue_2508_number_of_values_with_single_value_name()
2299 Arg::new("some_arg_issue") in issue_2508_number_of_values_with_single_value_name()
2321 let cmd = Command::new("test") in missing_positional_final_required()
2323 .arg(Arg::new("arg1")) in missing_positional_final_required()
2324 .arg(Arg::new("arg2").required(true)); in missing_positional_final_required()
2344 let cmd = Command::new("test") in missing_positional_final_multiple()
2346 .arg(Arg::new("foo")) in missing_positional_final_multiple()
2347 .arg(Arg::new("bar")) in missing_positional_final_multiple()
2348 .arg(Arg::new("baz").action(ArgAction::Set).num_args(1..)); in missing_positional_final_multiple()
2369 let cmd = Command::new("test").arg( in positional_multiple_values_is_dotted()
2370 Arg::new("foo") in positional_multiple_values_is_dotted()
2390 let cmd = Command::new("test").arg( in positional_multiple_values_is_dotted()
2391 Arg::new("foo") in positional_multiple_values_is_dotted()
2415 let cmd = Command::new("test").arg( in positional_multiple_occurrences_is_dotted()
2416 Arg::new("foo") in positional_multiple_occurrences_is_dotted()
2437 let cmd = Command::new("test").arg( in positional_multiple_occurrences_is_dotted()
2438 Arg::new("foo") in positional_multiple_occurrences_is_dotted()
2463 let cmd = Command::new("test").arg( in too_few_value_names_is_dotted()
2464 Arg::new("foo") in too_few_value_names_is_dotted()
2488 Command::new("test") in too_many_value_names_panics()
2490 Arg::new("foo") in too_many_value_names_panics()
2502 let res = Command::new("foo") in disabled_help_flag()
2503 .subcommand(Command::new("sub")) in disabled_help_flag()
2513 let res = Command::new("foo") in disabled_help_flag_and_subcommand()
2514 .subcommand(Command::new("sub")) in disabled_help_flag_and_subcommand()
2530 let cmd = Command::new("bar") in override_help_subcommand()
2531 .subcommand(Command::new("help").arg(Arg::new("arg").action(ArgAction::Set))) in override_help_subcommand()
2532 .subcommand(Command::new("not_help").arg(Arg::new("arg").action(ArgAction::Set))) in override_help_subcommand()
2547 let cmd = Command::new("foo") in override_help_flag_using_long()
2548 .subcommand(Command::new("help").long_flag("help")) in override_help_flag_using_long()
2557 let cmd = Command::new("foo") in override_help_flag_using_short()
2560 .subcommand(Command::new("help").short_flag('h')); in override_help_flag_using_short()
2569 let cmd = Command::new("example").subcommand(Command::new("test").about("Subcommand")); in subcommand_help_doesnt_have_useless_help_flag()
2588 let mut cmd = Command::new("test_app") in disable_help_flag_affects_help_subcommand()
2590 .subcommand(Command::new("test").about("Subcommand")); in disable_help_flag_affects_help_subcommand()
2608 let cmd = clap::Command::new("example") in dont_propagate_version_to_help_subcommand()
2611 .subcommand(clap::Command::new("subcommand")); in dont_propagate_version_to_help_subcommand()
2632 let mut cmd = clap::Command::new("test") in help_without_short()
2658 let cmd = Command::new("parent") in parent_cmd_req_in_usage_with_help_flag()
2660 .arg(Arg::new("TARGET").required(true).help("some")) in parent_cmd_req_in_usage_with_help_flag()
2662 Arg::new("ARGS") in parent_cmd_req_in_usage_with_help_flag()
2667 .subcommand(Command::new("test").about("some")); in parent_cmd_req_in_usage_with_help_flag()
2681 let cmd = Command::new("parent") in parent_cmd_req_in_usage_with_help_subcommand()
2683 .arg(Arg::new("TARGET").required(true).help("some")) in parent_cmd_req_in_usage_with_help_subcommand()
2685 Arg::new("ARGS") in parent_cmd_req_in_usage_with_help_subcommand()
2690 .subcommand(Command::new("test").about("some")); in parent_cmd_req_in_usage_with_help_subcommand()
2704 let mut cmd = Command::new("parent") in parent_cmd_req_in_usage_with_render_help()
2706 .arg(Arg::new("TARGET").required(true).help("some")) in parent_cmd_req_in_usage_with_render_help()
2708 Arg::new("ARGS") in parent_cmd_req_in_usage_with_render_help()
2713 .subcommand(Command::new("test").about("some")); in parent_cmd_req_in_usage_with_render_help()
2730 let cmd = Command::new("ctest") in parent_cmd_req_ignored_when_negates_reqs()
2733 .subcommand(Command::new("subcmd")); in parent_cmd_req_ignored_when_negates_reqs()
2746 let cmd = Command::new("ctest") in parent_cmd_req_ignored_when_conflicts()
2749 .subcommand(Command::new("subcmd")); in parent_cmd_req_ignored_when_conflicts()
2755 let cmd = Command::new("ctest") in no_wrap_help()
2763 let mut cmd = Command::new("app").bin_name("app.exe"); in display_name_default()
2770 let mut cmd = Command::new("app") in display_name_explicit()
2779 let mut cmd = Command::new("parent").subcommand(Command::new("child").bin_name("child.exe")); in display_name_subcommand_default()
2789 let mut cmd = Command::new("parent").subcommand( in display_name_subcommand_explicit()
2790 Command::new("child") in display_name_subcommand_explicit()