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

Commit cc02c81

Browse files
committed
added a method to return the short command when given a long command
1 parent 6fe633d commit cc02c81

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

core/lib/PatternLab/Console.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,21 @@ public function findCommandValue($args) {
7272
return false;
7373
}
7474

75+
/**
76+
* Find the short command for a given long gommand
77+
* @param {String} long command to search for
78+
*
79+
* @return {String} the search command
80+
*/
81+
public function findCommandShort($arg) {
82+
foreach ($this->commands as $command => $commandOptions) {
83+
if ($commandOptions["commandLong"] == $arg) {
84+
return $command;
85+
}
86+
}
87+
return false;
88+
}
89+
7590
/**
7691
* Return the command that was given in the command line arguments
7792
*

0 commit comments

Comments
 (0)