Skip to content

Commit e1ebf78

Browse files
committed
fix: use shlex.split for proper command argument parsing in interactive mode
Replace click.parser.split_arg_string with shlex.split to handle quoted arguments correctly in the interactive CLI mode. This ensures that quoted strings with spaces are properly preserved as single arguments rather than being split incorrectly. Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent b8ae7e4 commit e1ebf78

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/frequenz/client/dispatch/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import asyncio
77
import os
8+
import shlex
89
from datetime import datetime, timezone
910
from pprint import pformat
1011
from typing import Any, List
@@ -671,7 +672,7 @@ async def display_help() -> None:
671672
params = (
672673
["--url", url, "--auth-key", auth_key]
673674
+ (["--sign-secret", sign_secret] if sign_secret else [])
674-
+ click.parser.split_arg_string(user_input)
675+
+ shlex.split(user_input)
675676
)
676677

677678
try:

0 commit comments

Comments
 (0)