@@ -48,9 +48,9 @@ public void AddsSubcommands()
48
48
rm => { Assert . Equal ( "rm" , rm . Name ) ; } ) ;
49
49
}
50
50
51
- [ Command ( Name = "master " ) ]
51
+ [ Command ( Name = "top " ) ]
52
52
[ Subcommand ( typeof ( Level1Command ) ) ]
53
- private class MasterApp : CommandBase
53
+ private class TopApp : CommandBase
54
54
{
55
55
[ Option ( Inherited = true ) ]
56
56
public bool Verbose { get ; set ; }
@@ -66,7 +66,7 @@ private class Level1Command : CommandBase
66
66
67
67
protected override int OnExecute ( CommandLineApplication app ) => 101 ;
68
68
69
- public MasterApp ? Parent { get ; }
69
+ public TopApp ? Parent { get ; }
70
70
}
71
71
72
72
private class Level2Command : CommandBase
@@ -93,25 +93,25 @@ abstract class CommandBase
93
93
[ Fact ]
94
94
public void ItInvokesExecuteOnSubcommand_Bottom ( )
95
95
{
96
- var rc = CommandLineApplication . Execute < MasterApp > ( new TestConsole ( _output ) , "level1" , "level2" , "--value" ,
96
+ var rc = CommandLineApplication . Execute < TopApp > ( new TestConsole ( _output ) , "level1" , "level2" , "--value" ,
97
97
"6" ) ;
98
98
Assert . Equal ( 6 , rc ) ;
99
99
100
- rc = CommandLineApplication . Execute < MasterApp > ( new TestConsole ( _output ) , "level1" , "level2" ) ;
100
+ rc = CommandLineApplication . Execute < TopApp > ( new TestConsole ( _output ) , "level1" , "level2" ) ;
101
101
Assert . Equal ( 102 , rc ) ;
102
102
}
103
103
104
104
[ Fact ]
105
105
public void ItInvokesExecuteOnSubcommand_Middle ( )
106
106
{
107
- var rc = CommandLineApplication . Execute < MasterApp > ( new TestConsole ( _output ) , "level1" ) ;
107
+ var rc = CommandLineApplication . Execute < TopApp > ( new TestConsole ( _output ) , "level1" ) ;
108
108
Assert . Equal ( 101 , rc ) ;
109
109
}
110
110
111
111
[ Fact ]
112
112
public void ItInvokesExecuteOnSubcommand_Top ( )
113
113
{
114
- var rc = CommandLineApplication . Execute < MasterApp > ( new TestConsole ( _output ) ) ;
114
+ var rc = CommandLineApplication . Execute < TopApp > ( new TestConsole ( _output ) ) ;
115
115
Assert . Equal ( 100 , rc ) ;
116
116
}
117
117
@@ -124,9 +124,9 @@ public void HandlesHelp_Bottom()
124
124
{
125
125
Out = output ,
126
126
} ;
127
- var rc = CommandLineApplication . Execute < MasterApp > ( console , "level1" , "level2" , "--help" ) ;
127
+ var rc = CommandLineApplication . Execute < TopApp > ( console , "level1" , "level2" , "--help" ) ;
128
128
Assert . Equal ( 0 , rc ) ;
129
- Assert . Contains ( "Usage: master level1 level2 [options]" , sb . ToString ( ) ) ;
129
+ Assert . Contains ( "Usage: top level1 level2 [options]" , sb . ToString ( ) ) ;
130
130
}
131
131
132
132
[ Fact ]
@@ -138,9 +138,9 @@ public void HandlesHelp_Middle()
138
138
{
139
139
Out = output ,
140
140
} ;
141
- var rc = CommandLineApplication . Execute < MasterApp > ( console , "level1" , "--help" ) ;
141
+ var rc = CommandLineApplication . Execute < TopApp > ( console , "level1" , "--help" ) ;
142
142
Assert . Equal ( 0 , rc ) ;
143
- Assert . Contains ( "Usage: master level1 [command] [options]" , sb . ToString ( ) ) ;
143
+ Assert . Contains ( "Usage: top level1 [command] [options]" , sb . ToString ( ) ) ;
144
144
}
145
145
146
146
[ Fact ]
@@ -152,15 +152,15 @@ public void HandlesHelp_Top()
152
152
{
153
153
Out = output ,
154
154
} ;
155
- var rc = CommandLineApplication . Execute < MasterApp > ( console , "--help" ) ;
155
+ var rc = CommandLineApplication . Execute < TopApp > ( console , "--help" ) ;
156
156
Assert . Equal ( 0 , rc ) ;
157
- Assert . Contains ( "Usage: master [command] [options]" , sb . ToString ( ) ) ;
157
+ Assert . Contains ( "Usage: top [command] [options]" , sb . ToString ( ) ) ;
158
158
}
159
159
160
160
[ Fact ]
161
161
public void ItCreatesNestedSubCommands ( )
162
162
{
163
- var app = new CommandLineApplication < MasterApp > ( ) ;
163
+ var app = new CommandLineApplication < TopApp > ( ) ;
164
164
app . Conventions . UseSubcommandAttributes ( ) . UseCommandAttribute ( ) . UseCommandNameFromModelType ( ) ;
165
165
var lvl1 = Assert . Single ( app . Commands ) ;
166
166
Assert . Equal ( "level1" , lvl1 . Name ) ;
@@ -171,7 +171,7 @@ public void ItCreatesNestedSubCommands()
171
171
[ Fact ]
172
172
public void ItBindsOptionsOnParentItems ( )
173
173
{
174
- var app = CommandLineParser . ParseArgs < MasterApp > ( "level1" , "--mid" , "level2" , "--verbose" , "--value" , "6" ) ;
174
+ var app = CommandLineParser . ParseArgs < TopApp > ( "level1" , "--mid" , "level2" , "--verbose" , "--value" , "6" ) ;
175
175
Assert . IsType < Level1Command > ( app . Subcommand ) ;
176
176
var sub = Assert . IsType < Level2Command > ( app . Subcommand ? . Subcommand ) ;
177
177
Assert . NotNull ( sub . Parent ) ;
0 commit comments