diff --git a/gptcli/cli.py b/gptcli/cli.py index 1d60a04..39a5668 100644 --- a/gptcli/cli.py +++ b/gptcli/cli.py @@ -10,6 +10,7 @@ from rich.live import Live from rich.markdown import Markdown from .markdown import CustomMarkdown + from rich.text import Text from gptcli.session import (ALL_COMMANDS, COMMAND_CLEAR, COMMAND_QUIT, @@ -110,6 +111,15 @@ def response_streamer(self) -> ResponseStreamer: return CLIResponseStreamer(self.console, self.markdown) +# def parse_args(input: str, parse_args = False) -> Tuple[str, Dict[str, Any]]: +# args = {} +# if parse_args: +# regex = r"--(\w+)(?:\s+|=)([^\s]+)" +# matches = re.findall(regex, input) +# if matches: +# args = dict(matches) +# input = input.split("--")[0].strip() + def parse_args(input: str) -> Tuple[str, Dict[str, Any]]: # Extract parts enclosed in specific delimiters (triple backticks, triple quotes, single backticks) extracted_parts = []