File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
src/System.CommandLine/Parsing Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -166,5 +166,14 @@ public T ValueForOption<T>(string alias)
166
166
167
167
public OptionResult ? FindResultFor ( IOption option ) =>
168
168
_rootCommandResult . FindResultFor ( option ) ;
169
+
170
+ public SymbolResult ? FindResultFor ( ISymbol symbol ) =>
171
+ symbol switch
172
+ {
173
+ IArgument argument => FindResultFor ( argument ) ,
174
+ ICommand command => FindResultFor ( command ) ,
175
+ IOption option => FindResultFor ( option ) ,
176
+ _ => throw new ArgumentOutOfRangeException ( nameof ( symbol ) )
177
+ } ;
169
178
}
170
179
}
Original file line number Diff line number Diff line change @@ -159,7 +159,6 @@ argument.Parents[0] is ICommand command &&
159
159
builder . Append ( ">" ) ;
160
160
161
161
break ;
162
-
163
162
}
164
163
165
164
if ( includeArgumentName )
@@ -182,17 +181,6 @@ argument.Parents[0] is ICommand command &&
182
181
}
183
182
}
184
183
185
- public static SymbolResult ? FindResultFor (
186
- this ParseResult parseResult ,
187
- ISymbol symbol ) =>
188
- symbol switch
189
- {
190
- IArgument argument => parseResult . FindResultFor ( argument ) ,
191
- ICommand command => parseResult . FindResultFor ( command ) ,
192
- IOption option => parseResult . FindResultFor ( option ) ,
193
- _ => throw new ArgumentOutOfRangeException ( nameof ( symbol ) )
194
- } ;
195
-
196
184
public static bool HasOption (
197
185
this ParseResult parseResult ,
198
186
IOption option )
You can’t perform that action at this time.
0 commit comments