clidispatch: fix a minor case of debug command detection

Summary: This makes `config|debugconfig` as a debug command. Previously it was not.

Reviewed By: singhsrb

Differential Revision: D16866460

fbshipit-source-id: f1fcf0777d2fe6c1426f557ae1999710dd722109
This commit is contained in:
Jun Wu 2019-08-22 18:29:05 -07:00 committed by Facebook Github Bot
parent 62e7989ad9
commit b49ce531cc

View File

@ -138,7 +138,7 @@ fn command_map<'a>(
let config_commands = parse_list(cfg.get("commands", "names").unwrap_or_default());
for b_name in config_commands {
if let Ok(name) = String::from_utf8(b_name.to_vec()) {
let is_debug = name.starts_with("debug");
let is_debug = name.split("|").any(|name| name.starts_with("debug"));
for name in name.split("|") {
command_map.insert(name.to_string(), if is_debug { -i } else { i });
}