Skip to content

Commit 9455d8a

Browse files
committed
Skip extra processing when handling ParseError raised on early stage
This change prevent program from crashing, when ParseError is raised due to processing core args
1 parent 659d4c4 commit 9455d8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

invoke/program.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def run(self, argv: Optional[List[str]] = None, exit: bool = True) -> None:
410410
# problems.
411411
if isinstance(e, ParseError):
412412
print(e, file=sys.stderr)
413-
if self.args.suggestions.value:
413+
if "No idea what " in str(e) and self.args.suggestions.value:
414414
unrecognised_cmd = str(e).replace("No idea what '", "")
415415
unrecognised_cmd = unrecognised_cmd.replace("' is!", "")
416416
msg = self._possible_commands_msg(unrecognised_cmd)

0 commit comments

Comments
 (0)