Skip to content

Commit 998fb7a

Browse files
authored
Control plane example: rm --mode (#231)
1 parent bbc09df commit 998fb7a

File tree

1 file changed

+15
-6
lines changed
  • evi/evi-python-control-plane

1 file changed

+15
-6
lines changed

evi/evi-python-control-plane/main.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,21 @@ async def main() -> None:
352352
parser = argparse.ArgumentParser(
353353
description="EVI Control Plane Example - Control and observe EVI chats"
354354
)
355-
parser.add_argument(
356-
"--mode",
357-
type=str,
358-
choices=["new", "existing"],
359-
default="new",
360-
help="Mode to run: 'new' creates a new chat with microphone, 'existing' connects to an active chat",
355+
356+
mode_group = parser.add_mutually_exclusive_group(required=True)
357+
mode_group.add_argument(
358+
"--new",
359+
action="store_const",
360+
dest="mode",
361+
const="new",
362+
help="Create a new chat with microphone",
363+
)
364+
mode_group.add_argument(
365+
"--existing",
366+
action="store_const",
367+
dest="mode",
368+
const="existing",
369+
help="Connect to an existing active chat",
361370
)
362371

363372
args = parser.parse_args()

0 commit comments

Comments
 (0)