Skip to content

Commit 9ff5e2d

Browse files
committed
fixing more errors
1 parent 1daa8bc commit 9ff5e2d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

contentctl/contentctl.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import traceback
55
import warnings
6+
from dataclasses import dataclass
67

78
import 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+
181189
def 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__}'")

0 commit comments

Comments
 (0)