Skip to content

Commit 4cf3195

Browse files
committed
Add output format validation with table/json/csv/yaml support
1 parent e2b0115 commit 4cf3195

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/mefai_cli/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,12 @@ def get_api_key() -> str:
5858
def get_ws_url() -> str:
5959
"""Return the configured WebSocket URL."""
6060
return str(load_config().get("ws_url", DEFAULT_CONFIG["ws_url"]))
61+
62+
63+
DEFAULT_OUTPUT_FORMAT = "table"
64+
SUPPORTED_FORMATS = {"table", "json", "csv", "yaml"}
65+
66+
67+
def validate_output_format(fmt: str) -> str:
68+
"""Ensure output format is supported, fallback to table."""
69+
return fmt if fmt in SUPPORTED_FORMATS else DEFAULT_OUTPUT_FORMAT

0 commit comments

Comments
 (0)