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 33import sys
44import traceback
55import warnings
6+ from dataclasses import dataclass
67
78import tyro
89
@@ -178,6 +179,13 @@ def recognize_func():
178179 print (get_random_compliment ())
179180
180181
182+ @dataclass
183+ class RecognizeCommand :
184+ """Dummy subcommand for 'recognize' that requires no parameters."""
185+
186+ pass
187+
188+
181189def main ():
182190 print (CONTENTCTL_5_WARNING )
183191 try :
@@ -233,7 +241,7 @@ def main():
233241 "test_servers" : test_servers .model_construct (** t .__dict__ ),
234242 "release_notes" : release_notes .model_construct (** config_obj ),
235243 "deploy_acs" : deploy_acs .model_construct (** t .__dict__ ),
236- "recognize" : tyro . conf . subcommand (), # type: ignore
244+ "recognize" : RecognizeCommand (), # Use the dummy subcommand
237245 }
238246 )
239247
@@ -264,7 +272,7 @@ def main():
264272 deploy_acs_func (updated_config )
265273 elif type (config ) is test or type (config ) is test_servers :
266274 test_common_func (config )
267- elif type (config ) is tyro . conf . Subcommand :
275+ elif isinstance (config , RecognizeCommand ) :
268276 recognize_func ()
269277 else :
270278 raise Exception (f"Unknown command line type '{ type (config ).__name__ } '" )
You can’t perform that action at this time.
0 commit comments