diff options
| author | Jason Chang <jasonnc@google.com> | 2023-08-08 14:12:53 -0700 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-08-10 23:46:31 +0000 |
| commit | 1a3612fe6d347e458a53d7a9e920a91ea502e6ba (patch) | |
| tree | 02b1a61f1d97e32201ea5fa309bf1f1b6050e929 /subcmds/help.py | |
| parent | f0aeb220def22edfac9838288ad251f86da782c1 (diff) | |
| download | git-repo-1a3612fe6d347e458a53d7a9e920a91ea502e6ba.tar.gz | |
Raise RepoExitError in place of sys.exit
Bug: b/293344017
Change-Id: Icae4932b00e4068cba502a5ab4a0274fd7854d9d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382214
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Jason Chang <jasonnc@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Jason Chang <jasonnc@google.com>
Diffstat (limited to 'subcmds/help.py')
| -rw-r--r-- | subcmds/help.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/subcmds/help.py b/subcmds/help.py index 50a48047..593bf676 100644 --- a/subcmds/help.py +++ b/subcmds/help.py | |||
| @@ -26,6 +26,11 @@ from command import ( | |||
| 26 | ) | 26 | ) |
| 27 | import gitc_utils | 27 | import gitc_utils |
| 28 | from wrapper import Wrapper | 28 | from wrapper import Wrapper |
| 29 | from error import RepoExitError | ||
| 30 | |||
| 31 | |||
| 32 | class InvalidHelpCommand(RepoExitError): | ||
| 33 | """Invalid command passed into help.""" | ||
| 29 | 34 | ||
| 30 | 35 | ||
| 31 | class Help(PagedCommand, MirrorSafeCommand): | 36 | class Help(PagedCommand, MirrorSafeCommand): |
| @@ -202,7 +207,7 @@ Displays detailed usage information about a command. | |||
| 202 | print( | 207 | print( |
| 203 | "repo: '%s' is not a repo command." % name, file=sys.stderr | 208 | "repo: '%s' is not a repo command." % name, file=sys.stderr |
| 204 | ) | 209 | ) |
| 205 | sys.exit(1) | 210 | raise InvalidHelpCommand(name) |
| 206 | 211 | ||
| 207 | self._PrintCommandHelp(cmd) | 212 | self._PrintCommandHelp(cmd) |
| 208 | 213 | ||
