Skip to content

Commit

Permalink
Escapable blocks of text (kharvd#83)
Browse files Browse the repository at this point in the history
allow escapable blocks of text when wrapped in triple backticks or
quotes. Fixes kharvd#52
  • Loading branch information
sghael authored and CrustyCode committed Nov 11, 2024
1 parent b83f30d commit 824fa13
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gptcli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit 824fa13

Please sign in to comment.