[subcommands] support --help in subcommands

Summary:
Turns out that we were special-casing the `Infer Driver` case for no particular
reason and that was preventing `infer --diff --help` from working as expected.

Reviewed By: martinoluca

Differential Revision: D4666988

fbshipit-source-id: 0868d4b
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent b52a17eb75
commit a8ba910c69

@ -574,14 +574,7 @@ let set_curr_speclist_for_parse_action ~incomplete ~usage parse_action =
let mk_spec ~long ?(short="") spec doc = let mk_spec ~long ?(short="") spec doc =
pad_and_xform doc_width left_width { long; short; meta=""; spec; doc; pad_and_xform doc_width left_width { long; short; meta=""; spec; doc;
decode_json=fun _ -> raise (Arg.Bad long)} in decode_json=fun _ -> raise (Arg.Bad long)} in
if not (equal_parse_tag parse_tag (Infer ())) then if incomplete then
let skip opt =
(opt, Unit (fun () -> ()), "") in
speclist @ [
(skip "--help") ;
(skip "-help")
]
else if incomplete then
speclist @ [ speclist @ [
(unknown "--help") ; (unknown "--help") ;
(unknown "-help") (unknown "-help")

Loading…
Cancel
Save