/third_party/rust/crates/clap/tests/derive/ |
H A D | options.rs | 31 Opt::try_parse_from(["test", "-a42"]).unwrap() in required_option() 35 Opt::try_parse_from(["test", "-a", "42"]).unwrap() in required_option() 39 Opt::try_parse_from(["test", "--arg", "42"]).unwrap() in required_option() 43 Opt::try_parse_from(["test", "--arg", "24", "--arg", "42"]).unwrap() in required_option() 45 assert!(Opt::try_parse_from(["test"]).is_err()); in required_option() 58 Opt::try_parse_from(["test", "-a24"]).unwrap() in option_with_default() 62 Opt::try_parse_from(["test", "-a", "24", "-a", "42"]).unwrap() in option_with_default() 64 assert_eq!(Opt { arg: 42 }, Opt::try_parse_from(["test"]).unwrap()); in option_with_default() 77 Opt::try_parse_from(["test", "-a24"]).unwrap() in option_with_raw_default() 81 Opt::try_parse_from(["tes in option_with_raw_default() [all...] |
H A D | value_enum.rs | 30 Opt::try_parse_from(["", "foo"]).unwrap() in basic() 36 Opt::try_parse_from(["", "bar"]).unwrap() in basic() 38 assert!(Opt::try_parse_from(["", "fOo"]).is_err()); in basic() 65 Opt::try_parse_from(["", "foo"]).unwrap() in default_value() 71 Opt::try_parse_from(["", "bar"]).unwrap() in default_value() 77 Opt::try_parse_from([""]).unwrap() in default_value() 107 Opt::try_parse_from(["", "foo"]).unwrap() in vec_for_default_values_t() 114 Opt::try_parse_from(["", "bar"]).unwrap() in vec_for_default_values_t() 121 Opt::try_parse_from([""]).unwrap() in vec_for_default_values_t() 128 Opt::try_parse_from(["", " in vec_for_default_values_t() [all...] |
H A D | flags.rs | 30 assert_eq!(Opt { alice: false }, Opt::try_parse_from(["test"]).unwrap()); in bool_type_is_flag() 33 Opt::try_parse_from(["test", "-a"]).unwrap() in bool_type_is_flag() 37 Opt::try_parse_from(["test", "-a", "-a"]).unwrap() in bool_type_is_flag() 41 Opt::try_parse_from(["test", "--alice"]).unwrap() in bool_type_is_flag() 43 assert!(Opt::try_parse_from(["test", "-i"]).is_err()); in bool_type_is_flag() 44 assert!(Opt::try_parse_from(["test", "-a", "foo"]).is_err()); in bool_type_is_flag() 65 let opt = Opt::try_parse_from(["test"]).unwrap(); in non_bool_type_flag() 69 let opt = Opt::try_parse_from(["test", "-a"]).unwrap(); in non_bool_type_flag() 73 let opt = Opt::try_parse_from(["test", "-b"]).unwrap(); in non_bool_type_flag() 77 let opt = Opt::try_parse_from(["tes in non_bool_type_flag() [all...] |
H A D | subcommands.rs | 48 Opt::try_parse_from(["test", "fetch", "--all", "origin"]).unwrap() in test_fetch() 56 Opt::try_parse_from(["test", "fetch", "-f", "origin"]).unwrap() in test_fetch() 67 Opt::try_parse_from(["test", "add"]).unwrap() in test_add() 74 Opt::try_parse_from(["test", "add", "-i", "-v"]).unwrap() in test_add() 80 let result = Opt::try_parse_from(["test", "badcmd", "-i", "-v"]); in test_no_parse() 83 let result = Opt::try_parse_from(["test", "add", "--badoption"]); in test_no_parse() 86 let result = Opt::try_parse_from(["test"]); in test_no_parse() 103 Opt2::try_parse_from(["test", "do-something", "blah"]).unwrap() in test_hyphenated_subcommands() 116 assert_eq!(Opt3::Add, Opt3::try_parse_from(["test", "add"]).unwrap()); in test_null_commands() 117 assert_eq!(Opt3::Init, Opt3::try_parse_from(["tes in test_null_commands() [all...] |
H A D | naming.rs | 15 Opt::try_parse_from(["test", "--foo-option"]).unwrap() in test_standalone_long_generates_kebab_case() 29 Opt::try_parse_from(["test", "--foo"]).unwrap() in test_custom_long_overwrites_default_name() 43 Opt::try_parse_from(["test", "--foo"]).unwrap() in test_standalone_long_uses_previous_defined_custom_name() 57 Opt::try_parse_from(["test", "--foo-option"]).unwrap() in test_standalone_long_ignores_afterwards_defined_custom_name() 71 Opt::try_parse_from(["test", "--foo"]).unwrap() in test_standalone_long_uses_previous_defined_custom_id() 85 Opt::try_parse_from(["test", "--foo-option"]).unwrap() in test_standalone_long_ignores_afterwards_defined_custom_id() 100 Opt::try_parse_from(["test", "-f"]).unwrap() in test_standalone_short_generates_kebab_case() 114 Opt::try_parse_from(["test", "-o"]).unwrap() in test_custom_short_overwrites_default_name() 128 Opt::try_parse_from(["test", "-o"]).unwrap() in test_standalone_short_uses_previous_defined_custom_name() 142 Opt::try_parse_from(["tes in test_standalone_short_ignores_afterwards_defined_custom_name() [all...] |
H A D | arguments.rs | 27 Opt::try_parse_from(["test", "42"]).unwrap() in required_argument() 29 assert!(Opt::try_parse_from(["test"]).is_err()); in required_argument() 30 assert!(Opt::try_parse_from(["test", "42", "24"]).is_err()); in required_argument() 42 Opt::try_parse_from(["test", "24"]).unwrap() in argument_with_default() 44 assert_eq!(Opt { arg: 42 }, Opt::try_parse_from(["test"]).unwrap()); in argument_with_default() 45 assert!(Opt::try_parse_from(["test", "42", "24"]).is_err()); in argument_with_default() 61 Opt::try_parse_from(["test", "10"]).unwrap() in auto_value_name() 80 Opt::try_parse_from(["test", "10"]).unwrap() in explicit_value_name() 92 Opt::try_parse_from(["test", "42"]).unwrap() in option_type_is_optional() 94 assert_eq!(Opt { arg: None }, Opt::try_parse_from(["tes in option_type_is_optional() [all...] |
H A D | flatten.rs | 35 Opt::try_parse_from(["test", "42"]).unwrap() in flatten() 37 assert!(Opt::try_parse_from(["test"]).is_err()); in flatten() 38 assert!(Opt::try_parse_from(["test", "42", "24"]).is_err()); in flatten() 58 Opt::try_parse_from(["test", "42", "43"]).unwrap(); in flatten_twice() 93 Opt::try_parse_from(["test", "fetch", "42"]).unwrap() in flatten_in_subcommand() 100 Opt::try_parse_from(["test", "add", "-i", "43"]).unwrap() in flatten_in_subcommand() 121 assert_eq!(Opt::try_parse_from(["test", "42"]).unwrap(), opt); in update_args_with_flatten() 127 assert_eq!(Opt::try_parse_from(["test", "52"]).unwrap(), opt); in update_args_with_flatten() 158 Opt::try_parse_from(["test", "command1", "42", "44"]).unwrap() in merge_subcommands_with_flatten() 162 Opt::try_parse_from(["tes in merge_subcommands_with_flatten() [all...] |
H A D | non_literal_attributes.rs | 53 Opt::try_parse_from(["test", "-l", "1"]).unwrap() in test_slice() 62 Opt::try_parse_from(["test", "--level", "1"]).unwrap() in test_slice() 71 Opt::try_parse_from(["test", "--set-level", "1"]).unwrap() in test_slice() 80 Opt::try_parse_from(["test", "--lvl", "1"]).unwrap() in test_slice() 93 Opt::try_parse_from(["test", "-l", "1", "file"]).unwrap() in test_multi_args() 102 Opt::try_parse_from(["test", "-l", "1", "--values", "1", "--", "FILE"]).unwrap() in test_multi_args() 108 let result = Opt::try_parse_from(["test", "-l", "1", "--", "FILE"]); in test_multi_args_fail() 121 Opt::try_parse_from(["test", "-l", "1", "--x=1"]).unwrap() in test_bool() 123 let result = Opt::try_parse_from(["test", "-l", "1", "--x", "1"]); in test_bool() 143 HexOpt::try_parse_from(["tes in test_parse_hex_function_path() [all...] |
H A D | default_value.rs | 14 assert_eq!(Opt { arg: 3 }, Opt::try_parse_from(["test"]).unwrap()); in default_value() 15 assert_eq!(Opt { arg: 1 }, Opt::try_parse_from(["test", "1"]).unwrap()); in default_value() 28 assert_eq!(Opt { arg: 3 }, Opt::try_parse_from(["test"]).unwrap()); in default_value_t() 29 assert_eq!(Opt { arg: 1 }, Opt::try_parse_from(["test", "1"]).unwrap()); in default_value_t() 42 assert_eq!(Opt { arg: 0 }, Opt::try_parse_from(["test"]).unwrap()); in auto_default_value_t() 43 assert_eq!(Opt { arg: 1 }, Opt::try_parse_from(["test", "1"]).unwrap()); in auto_default_value_t() 80 Opt::try_parse_from(["test"]).unwrap() in default_values_t() 91 Opt::try_parse_from(["test", "1"]).unwrap() in default_values_t() 102 Opt::try_parse_from(["test", "--arg4", "42", "--arg4", "15", "--arg5", "baz"]).unwrap() in default_values_t() 120 Opt::try_parse_from(["tes in default_value_os_t() [all...] |
H A D | utf8.rs | 21 let m = Positional::try_parse_from(vec![OsString::from(""), OsString::from_vec(vec![0xe9])]); in invalid_utf8_strict_positional() 28 let m = Named::try_parse_from(vec![ in invalid_utf8_strict_option_short_space() 39 let m = Named::try_parse_from(vec![ in invalid_utf8_strict_option_short_equals() 49 let m = Named::try_parse_from(vec![ in invalid_utf8_strict_option_short_no_space() 59 let m = Named::try_parse_from(vec![ in invalid_utf8_strict_option_long_space() 70 let m = Named::try_parse_from(vec![ in invalid_utf8_strict_option_long_equals() 91 let r = PositionalOs::try_parse_from(vec![OsString::from(""), OsString::from_vec(vec![0xe9])]); in invalid_utf8_positional() 102 let r = NamedOs::try_parse_from(vec![ in invalid_utf8_option_short_space() 117 let r = NamedOs::try_parse_from(vec![ in invalid_utf8_option_short_equals() 131 let r = NamedOs::try_parse_from(ve in invalid_utf8_option_short_no_space() [all...] |
H A D | issues.rs | 24 assert!(Cli::try_parse_from(["test"]).is_err()); in issue_151_groups_within_subcommands() 25 assert!(Cli::try_parse_from(["test", "--foo=v1"]).is_ok()); in issue_151_groups_within_subcommands() 26 assert!(Cli::try_parse_from(["test", "--bar=v2"]).is_ok()); in issue_151_groups_within_subcommands() 27 assert!(Cli::try_parse_from(["test", "--zebra=v3"]).is_err()); in issue_151_groups_within_subcommands() 28 assert!(Cli::try_parse_from(["test", "--foo=v1", "--bar=v2"]).is_ok()); in issue_151_groups_within_subcommands() 49 assert!(Args::try_parse_from(["test", "some-command", "test-command"]).is_ok()); in issue_289() 50 assert!(Args::try_parse_from(["test", "some", "test-command"]).is_ok()); in issue_289() 51 assert!(Args::try_parse_from(["test", "some-command", "test"]).is_ok()); in issue_289() 52 assert!(Args::try_parse_from(["test", "some", "test"]).is_ok()); in issue_289()
|
H A D | nested_subcommands.rs | 45 let result = Opt::try_parse_from(["test"]); in test_no_cmd() 54 Opt2::try_parse_from(["test"]).unwrap() in test_no_cmd() 66 Opt::try_parse_from(["test", "-vvv", "fetch"]).unwrap() in test_fetch() 74 Opt::try_parse_from(["test", "--force", "fetch"]).unwrap() in test_fetch() 86 Opt::try_parse_from(["test", "add"]).unwrap() in test_add() 94 Opt::try_parse_from(["test", "-vv", "add"]).unwrap() in test_add() 100 let result = Opt::try_parse_from(["test", "badcmd"]); in test_badinput() 102 let result = Opt::try_parse_from(["test", "add", "--verbose"]); in test_badinput() 104 let result = Opt::try_parse_from(["test", "--badopt", "add"]); in test_badinput() 106 let result = Opt::try_parse_from(["tes in test_badinput() [all...] |
H A D | skip.rs | 21 assert!(Opt::try_parse_from(["test", "-x", "10", "20"]).is_err()); in skip_1() 23 let mut opt = Opt::try_parse_from(["test", "-x", "10"]).unwrap(); in skip_1() 57 Opt::try_parse_from(["test", "-x", "10", "20", "30"]).unwrap(), in skip_2() 95 Opt::try_parse_from(["test", "-n", "10"]).unwrap(), in skip_enum() 125 Opt::try_parse_from(["test", "-n", "10"]).unwrap(), in skip_help_doc_comments() 150 Opt::try_parse_from(["test", "-n", "10"]).unwrap(), in skip_val()
|
H A D | occurrences.rs | 16 Opt::try_parse_from(&["test", "-p", "1", "2", "-p", "0", "0"]).unwrap() in test_vec_of_vec() 36 Opt::try_parse_from(["test", "-p", "1,2", "-p", "a,b"]).unwrap(), in test_vec_of_vec_opt_out() 50 Opt::try_parse_from(&["test"]).unwrap() in test_vec_vec_empty() 66 Opt::try_parse_from(&["test", "-p", "1", "2", "-p", "3", "4"]).unwrap() in test_option_vec_vec() 80 Opt::try_parse_from(&["test"]).unwrap() in test_option_vec_vec_empty()
|
H A D | basic.rs | 26 Opt::try_parse_from(["test", "-a24"]).unwrap() in basic() 40 let mut opt = Opt::try_parse_from(["test", "-f0", "-s1"]).unwrap(); in update_basic() 63 let mut opt = Opt::try_parse_from(["test", "-f0", "-s1"]).unwrap(); in update_explicit_required() 81 assert_eq!(Opt {}, Opt::try_parse_from(["test"]).unwrap()); in unit_struct()
|
H A D | custom_string_parsers.rs | 52 PathOpt::try_parse_from([ in test_path_opt_simple() 75 HexOpt::try_parse_from(["test", "-n", "5"]).unwrap() in test_parse_hex() 81 HexOpt::try_parse_from(["test", "-n", "abcdef"]).unwrap() in test_parse_hex() 84 let err = HexOpt::try_parse_from(["test", "-n", "gg"]).unwrap_err(); in test_parse_hex() 114 NoOpOpt::try_parse_from(["test", "-b=?"]).unwrap() in test_every_custom_parser() 143 DefaultedOpt::try_parse_from(["test", "-i", "9000", "-p", "src/lib.rs",]).unwrap() in test_parser_with_default_value()
|
H A D | raw_idents.rs | 15 Opt::try_parse_from(["test", "--type", "long"]).unwrap() in raw_idents() 22 Opt::try_parse_from(["test", "-t", "short"]).unwrap() in raw_idents()
|
H A D | deny_warnings.rs | 34 Opt::try_parse_from(["test", "foo"]).unwrap() in warning_never_struct() 51 Opt::try_parse_from(["test", "foo", "foo"]).unwrap() in warning_never_enum()
|
H A D | explicit_name_no_renaming.rs | 15 Opt::try_parse_from(["test", "--.foo", "long"]).unwrap() in explicit_short_long_no_rename() 22 Opt::try_parse_from(["test", "-.", "short"]).unwrap() in explicit_short_long_no_rename()
|
H A D | help.rs | 214 let result = Opts::try_parse_from(["test", "sub"]); in derive_generated_error_has_full_context() 438 let result = CliOptions::try_parse_from(["cmd", "--verbose-help"]); in custom_help_flag() 442 CliOptions::try_parse_from(["cmd"]).unwrap(); in custom_help_flag() 454 let result = CliOptions::try_parse_from(["cmd", "--verbose-version"]); in custom_version_flag() 458 CliOptions::try_parse_from(["cmd"]).unwrap(); in custom_version_flag()
|
H A D | boxed.rs | 30 Opt::try_parse_from(["test", "flame", "1"]).unwrap() in boxed_flatten_subcommand() 36 let mut opt = Opt::try_parse_from(["test", "flame", "1"]).unwrap(); in update_boxed_flatten_subcommand()
|
H A D | raw_bool_literal.rs | 27 Opt::try_parse_from(["test", "one", "--", "--help"]).unwrap() in raw_bool_literal()
|
H A D | type_alias_regressions.rs | 33 Opts::try_parse_from(["test", "value", "--choice=foo", "do-something"]).unwrap(); in type_alias_regressions()
|
H A D | utils.rs | 53 let res = P::try_parse_from(args.split(' ').collect::<Vec<_>>()); in assert_output()
|
/third_party/rust/crates/clap/src/ |
H A D | derive.rs | 121 fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> in try_parse_from() functions 414 fn try_parse_from<I, It>(itr: I) -> Result<Self, Error> in try_parse_from() functions 419 <T as Parser>::try_parse_from(itr).map(Box::new) in try_parse_from()
|