Mercurial > hg
changeset 38130:a40cc6d7d8c3
githelp: cleanup one more abort message
This makes the string localizable, uses the more standard hint argument, quotes
the problem option so it stands out, and kills a stray apostrophe.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 22 May 2018 23:48:08 -0400 |
parents | c65931d23baf |
children | 46c2b19a1263 |
files | hgext/githelp.py tests/test-githelp.t |
diffstat | 2 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/githelp.py Tue May 22 20:43:42 2018 +0900 +++ b/hgext/githelp.py Tue May 22 23:48:08 2018 -0400 @@ -94,10 +94,9 @@ try: args.remove(flag) except Exception: - raise error.Abort( - "unknown option {0} packed with other options\n" - "Please try passing the option as it's own flag: -{0}" \ - .format(ex.opt)) + msg = _("unknown option '{0}' packed with other options") + hint = _("please try passing the option as its own flag: -{0}") + raise error.Abort(msg.format(ex.opt), hint=hint.format(ex.opt)) ui.warn(_("ignoring unknown option %s\n") % flag)
--- a/tests/test-githelp.t Tue May 22 20:43:42 2018 +0900 +++ b/tests/test-githelp.t Tue May 22 23:48:08 2018 -0400 @@ -43,8 +43,8 @@ githelp on a command with unrecognized option packed with other options should fail with error $ hg githelp -- commit -pv - abort: unknown option v packed with other options - Please try passing the option as it's own flag: -v + abort: unknown option 'v' packed with other options + (please try passing the option as its own flag: -v) [255] githelp for git rebase --skip