Mercurial > hg
comparison hgeditor @ 46608:4e4c70401028
rhg: Use clap’s support for global CLI arguments
By default, clap only accepts app-level arguments (as opposed to sub-command
level) to be specified before a sub-command: `rhg -R ./foo log`. Specifying
them after would be rejected: `rhg log -R ./foo`.
Previously we worked around that by registering global arguments both
at the app level and on each sub-command, but that required looking
for their value in two places. It turns out that Clap has built-in support
for what we want to do, so let’s use it.
Also, Clap "settings" turn out to be either global or not too.
Let’s make `AllowInvalidUtf8` apply to sub-commands too.
Differential Revision: https://phab.mercurial-scm.org/D10080
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Fri, 26 Feb 2021 12:16:43 +0100 |
parents | 1aee2ab0f902 |
children |
comparison
equal
deleted
inserted
replaced
46607:e9901d01d135 | 46608:4e4c70401028 |
---|