File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
src/System.CommandLine.Tests/Help Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,34 @@ public void Usage_section_for_subcommand_shows_arguments_for_subcommand_and_pare
249249 _console . ToString ( ) . Should ( ) . Contain ( expected ) ;
250250 }
251251
252+ [ Fact ]
253+ public void Usage_section_for_subcommand_shows_arguments_for_subcommand_and_parent_command_not_optional ( )
254+ {
255+ var arg = new Argument < string [ ] >
256+ {
257+ Name = "shared-args" ,
258+ Arity = ArgumentArity . OneOrMore
259+ } ;
260+
261+ var inner = new Command ( "inner" , "command help" )
262+ {
263+ arg
264+ } ;
265+ _ = new Command ( "outer" , "command help" )
266+ {
267+ inner ,
268+ arg
269+ } ;
270+
271+ _helpBuilder . Write ( inner , _console ) ;
272+
273+ var expected =
274+ $ "Usage:{ NewLine } " +
275+ $ "{ _indentation } outer <shared-args>... inner <shared-args>...";
276+
277+ _console . ToString ( ) . Should ( ) . Contain ( expected ) ;
278+ }
279+
252280 [ Fact ]
253281 public void Usage_section_does_not_show_additional_arguments_when_TreatUnmatchedTokensAsErrors_is_not_specified ( )
254282 {
You can’t perform that action at this time.
0 commit comments