Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 4424e44

Browse files
committed
now use the command given after help to write out the appropriate help section
1 parent 7d851c7 commit 4424e44

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

core/builder.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
$console->setCommand("v","version","Print the version number","The version command prints out the current version of Pattern Lab.");
5656

5757
// set-up the help command
58-
$console->setCommand("h","help","Print the help for a given command","The help command prints out the help for a given flag. Just use -h with another command and it will tell you all of the options.");
58+
$console->setCommand("h:","help:","Print the help for a given command","The help command prints out the help for a given flag. Just use -h with another command and it will tell you all of the options.");
5959

6060
/*******************************
6161
* Figure out what to run
@@ -64,10 +64,13 @@
6464
// get what was passed on the command line
6565
$console->getArguments();
6666

67-
if ($console->findCommand("h|help") && ($command = $console->getCommand())) {
67+
if ($console->findCommand("h|help")) {
6868

69-
// write the usage & help for a specific command
70-
$console->writeHelpCommand($command);
69+
$helpCommand = $console->findCommandValue("h|help");
70+
$helpCommand = str_replace("-","",$helpCommand);
71+
$helpCommand = (strlen($helpCommand) == 1) ? $helpCommand : $console->findCommandShort($helpCommand);
72+
73+
$helpCommand ? $console->writeHelpCommand($helpCommand) : $console->writeHelp();
7174

7275
} else if ($command = $console->getCommand()) {
7376

0 commit comments

Comments
 (0)