pycliparser: do not hardcode globalopts in parsecommand

Summary:
The only callsite in dispatch.py actually provide the global flags. So there is
no need to append the global flags again. This makes `parsecommand` more flexible.

Reviewed By: danielocfb

Differential Revision: D33489536

fbshipit-source-id: 05d623a3ec51d585d9307cb5660d841d6d222bc2
This commit is contained in:
Jun Wu 2022-01-18 17:19:06 -08:00 committed by Facebook GitHub Bot
parent 2ec38bb655
commit b0cb9bc5a8

View File

@ -119,8 +119,7 @@ fn parse_command(
args: Vec<String>,
definitions: Vec<FlagDef>,
) -> PyResult<(Vec<Str>, HashMap<Str, Value>)> {
let mut flags: Vec<Flag> = definitions.into_iter().map(Into::into).collect();
flags.extend(HgGlobalOpts::flags());
let flags: Vec<Flag> = definitions.into_iter().map(Into::into).collect();
let result = ParseOptions::new()
.flag_alias("repo", "repository")