File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
clap_complete/tests/testsuite Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,27 @@ goodbye-world
263263 ) ;
264264}
265265
266+ #[ test]
267+ fn suggest_subcommand_positional_after_escape ( ) {
268+ let mut cmd = Command :: new ( "exhaustive" ) . subcommand ( Command :: new ( "hello-world" ) . arg (
269+ clap:: Arg :: new ( "hello-world" ) . value_parser ( [
270+ PossibleValue :: new ( "hello-world" ) . help ( "Say hello to the world" ) ,
271+ "hello-moon" . into ( ) ,
272+ "goodbye-world" . into ( ) ,
273+ ] ) ,
274+ ) ) ;
275+
276+ assert_data_eq ! (
277+ complete!( cmd, "hello-world -- [TAB]" ) ,
278+ snapbox:: str ![ [ r#"
279+ hello-world Say hello to the world
280+ hello-moon
281+ goodbye-world
282+ --help Print help (see more with '--help')
283+ "# ] ] ,
284+ ) ;
285+ }
286+
266287#[ test]
267288fn suggest_argument_value ( ) {
268289 let mut cmd = Command :: new ( "dynamic" )
You can’t perform that action at this time.
0 commit comments