Skip to content

Commit

Permalink
Identify --help and -h during args preprocessing, and convert to 'hel…
Browse files Browse the repository at this point in the history
…p' command if found. (#2983)
  • Loading branch information
greg-1-anderson authored Sep 28, 2017
1 parent 25ffafc commit e508eae
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Preflight/PreflightArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,22 @@ public function optionsWithValues()
'--backend' => 'setBackend',
'--drush-coverage=' => 'setCoverageFile',
'--strict=' => 'setStrict',
'--help' => 'adjustHelpOption',
'-h' => 'adjustHelpOption',
];
}

/**
* If the user enters '--help' or '-h', thrown that
* option away and add a 'help' command to the beginning
* of the argument list.
*/
public function adjustHelpOption()
{
$drushPath = array_shift($this->args);
array_unshift($this->args, $drushPath, 'help');
}

/**
* Map of option key to the corresponding config key to store the
* preflight option in.
Expand Down

0 comments on commit e508eae

Please sign in to comment.