1Following are tests for the interop examples in this directory. 2 3## Augment Args 4 5```console 6$ interop_augment_args 7Value of built: false 8Value of derived via ArgMatches: false 9Value of derived: DerivedArgs { 10 derived: false, 11} 12 13``` 14 15```console 16$ interop_augment_args -b --derived 17Value of built: true 18Value of derived via ArgMatches: true 19Value of derived: DerivedArgs { 20 derived: true, 21} 22 23``` 24 25```console 26$ interop_augment_args -d --built 27Value of built: true 28Value of derived via ArgMatches: true 29Value of derived: DerivedArgs { 30 derived: true, 31} 32 33``` 34 35```console 36$ interop_augment_args --unknown 37? failed 38error: unexpected argument '--unknown' found 39 40Usage: interop_augment_args[EXE] [OPTIONS] 41 42For more information, try '--help'. 43 44``` 45 46## Augment Subcommands 47 48```console 49$ interop_augment_subcommands 50? failed 51error: A subcommand is required but one was not provided. 52``` 53 54```console 55$ interop_augment_subcommands derived 56Derived subcommands: Derived { 57 derived_flag: false, 58} 59 60``` 61 62```console 63$ interop_augment_subcommands derived --derived-flag 64Derived subcommands: Derived { 65 derived_flag: true, 66} 67 68``` 69 70```console 71$ interop_augment_subcommands derived --unknown 72? failed 73error: unexpected argument '--unknown' found 74 75Usage: interop_augment_subcommands[EXE] derived [OPTIONS] 76 77For more information, try '--help'. 78 79``` 80 81```console 82$ interop_augment_subcommands unknown 83? failed 84error: unrecognized subcommand 'unknown' 85 86Usage: interop_augment_subcommands[EXE] [COMMAND] 87 88For more information, try '--help'. 89 90``` 91 92## Hand-Implemented Subcommand 93 94```console 95$ interop_hand_subcommand 96? failed 97Usage: interop_hand_subcommand[EXE] [OPTIONS] <COMMAND> 98 99Commands: 100 add 101 remove 102 help Print this message or the help of the given subcommand(s) 103 104Options: 105 -t, --top-level 106 -h, --help Print help 107 108``` 109 110```console 111$ interop_hand_subcommand add 112Cli { 113 top_level: false, 114 subcommand: Add( 115 AddArgs { 116 name: [], 117 }, 118 ), 119} 120 121``` 122 123```console 124$ interop_hand_subcommand add a b c 125Cli { 126 top_level: false, 127 subcommand: Add( 128 AddArgs { 129 name: [ 130 "a", 131 "b", 132 "c", 133 ], 134 }, 135 ), 136} 137 138``` 139 140```console 141$ interop_hand_subcommand add --unknown 142? failed 143error: unexpected argument '--unknown' found 144 145 note: to pass '--unknown' as a value, use '-- --unknown' 146 147Usage: interop_hand_subcommand[EXE] add [NAME]... 148 149For more information, try '--help'. 150 151``` 152 153```console 154$ interop_hand_subcommand remove 155Cli { 156 top_level: false, 157 subcommand: Remove( 158 RemoveArgs { 159 force: false, 160 name: [], 161 }, 162 ), 163} 164 165``` 166 167```console 168$ interop_hand_subcommand remove --force a b c 169Cli { 170 top_level: false, 171 subcommand: Remove( 172 RemoveArgs { 173 force: true, 174 name: [ 175 "a", 176 "b", 177 "c", 178 ], 179 }, 180 ), 181} 182 183``` 184 185```console 186$ interop_hand_subcommand unknown 187? failed 188error: unrecognized subcommand 'unknown' 189 190Usage: interop_hand_subcommand[EXE] [OPTIONS] <COMMAND> 191 192For more information, try '--help'. 193 194``` 195 196## Flatten Hand-Implemented Args 197 198```console 199$ interop_flatten_hand_args 200Cli { 201 top_level: false, 202 more_args: CliArgs { 203 foo: false, 204 bar: false, 205 quuz: None, 206 }, 207} 208 209``` 210 211```console 212$ interop_flatten_hand_args -f --bar 213Cli { 214 top_level: false, 215 more_args: CliArgs { 216 foo: true, 217 bar: true, 218 quuz: None, 219 }, 220} 221 222``` 223 224```console 225$ interop_flatten_hand_args --quuz abc 226Cli { 227 top_level: false, 228 more_args: CliArgs { 229 foo: false, 230 bar: false, 231 quuz: Some( 232 "abc", 233 ), 234 }, 235} 236 237``` 238 239```console 240$ interop_flatten_hand_args --unknown 241? failed 242error: unexpected argument '--unknown' found 243 244Usage: interop_flatten_hand_args[EXE] [OPTIONS] 245 246For more information, try '--help'. 247 248``` 249