Skip to content

Commit

Permalink
command line work
Browse files Browse the repository at this point in the history
  • Loading branch information
pldi21 committed Feb 14, 2024
1 parent 2fb5649 commit 0e13aa2
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/chatdbg/chatdbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ def interaction(self, frame, tb):

super().interaction(frame, tb)

# def _check_about_command(self, str):
# all_commands = self.completenames('')
# words = str.split(' ')
# word = words[0]
# if word in all_commands:
# if word in self._warned_keywords:
# return True
# else:
# self.message(f"It looks like you may be issuing a Pdb command.")
# self.message(f"If you did not mean to, start your line with :{word} instead of {word}.")
# self._warned_keywords.add(words[0])
# return True
# else:
# return True

def onecmd(self, line: str) -> bool:
"""
Expand Down Expand Up @@ -239,13 +253,13 @@ def format_history_entry(self, entry, indent = ''):
def _clear_history(self):
self._history = [ ]

# override to make lines starting with : be chat lines.
def default(self, line):
if line[:1] == ':':
line = line[1:].strip()
self.do_chat(line)
else:
if line[:1] == '!':
super().default(line)
else:
if line[:1] == ':':
line = line[1:].strip()
self.do_chat(line)

def do_hist(self, arg):
"""hist
Expand Down

0 comments on commit 0e13aa2

Please sign in to comment.