Summary:
We delegate parsing to `PhutilArgumentParser` but then skip the parts of the code which do something with this flag.
In particular, `arc --help list` just runs `arc list`.
See https://github.com/facebook/arcanist/issues/58
Test Plan: Ran `arc --help`, `arc list --help`, `arc --help list`, `arc --help help --help`. Got expected help in all cases.
Reviewers: vrana, chad, btrahan
Reviewed By: chad
CC: aran
Differential Revision: https://secure.phabricator.com/D4023
$force_conduit_version = $args->getArg('conduit-version');
$conduit_timeout = $args->getArg('conduit-timeout');
$load = $args->getArg('load-phutil-library');
+$help = $args->getArg('help');
$argv = $args->getUnconsumedArgumentVector();
$args = array_values($argv);
phutil_get_library_root('arcanist'));
if (!$args) {
- throw new ArcanistUsageException("No command provided. Try 'arc help'.");
+ if ($help) {
+ $args = array('help');
+ } else {
+ throw new ArcanistUsageException("No command provided. Try 'arc help'.");
+ }
+ } else if ($help) {
+ array_unshift($args, 'help');
}
$global_config = ArcanistBaseWorkflow::readGlobalArcConfig();