File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 3
3
import sys
4
4
import traceback
5
5
import warnings
6
+ from dataclasses import dataclass
6
7
7
8
import tyro
8
9
@@ -178,6 +179,13 @@ def recognize_func():
178
179
print (get_random_compliment ())
179
180
180
181
182
+ @dataclass
183
+ class RecognizeCommand :
184
+ """Dummy subcommand for 'recognize' that requires no parameters."""
185
+
186
+ pass
187
+
188
+
181
189
def main ():
182
190
print (CONTENTCTL_5_WARNING )
183
191
try :
@@ -233,7 +241,7 @@ def main():
233
241
"test_servers" : test_servers .model_construct (** t .__dict__ ),
234
242
"release_notes" : release_notes .model_construct (** config_obj ),
235
243
"deploy_acs" : deploy_acs .model_construct (** t .__dict__ ),
236
- "recognize" : tyro . conf . subcommand (), # type: ignore
244
+ "recognize" : RecognizeCommand (), # Use the dummy subcommand
237
245
}
238
246
)
239
247
@@ -264,7 +272,7 @@ def main():
264
272
deploy_acs_func (updated_config )
265
273
elif type (config ) is test or type (config ) is test_servers :
266
274
test_common_func (config )
267
- elif type (config ) is tyro . conf . Subcommand :
275
+ elif isinstance (config , RecognizeCommand ) :
268
276
recognize_func ()
269
277
else :
270
278
raise Exception (f"Unknown command line type '{ type (config ).__name__ } '" )
You can’t perform that action at this time.
0 commit comments