Airship\Hangar\Commands\Help::usageInfo PHP Method

usageInfo() public method

Display the usage information for this command.
public usageInfo ( array $args = [] ) : void
$args array - CLI arguments
return void
    public function usageInfo(array $args = [])
    {
        if (\count($args) == 0) {
            $this->helpMenu();
            return;
        }
        if (\strtolower($args[0]) !== 'help') {
            foreach ($this->commands as $i => $name) {
                if (\strtolower($args[0]) === $i) {
                    $com = $this->getCommandObject($name);
                    $com->usageInfo(\array_values(\array_slice($args, 1)));
                    return;
                }
            }
        }
        // Now let's actually print the usage info for this class
        $TAB = \str_repeat(' ', self::TAB_SIZE);
        $HTAB = \str_repeat(' ', (int) \ceil(self::TAB_SIZE / 2));
        echo $HTAB, $this->name, "\n";
        echo $TAB, $this->description, "\n\n";
        echo $HTAB, "How to use this command:\n";
        echo $TAB, $this->c['cyan'], "hangar ", $this->c[''], "\n";
        echo $TAB, $this->c['cyan'], "hangar help", $this->c[''], "\n";
        echo $TAB, $HTAB, "List all of the commands available to hangar.";
        echo "\n";
        echo $TAB, $this->c['cyan'] . "hangar help [command]", $this->c[''], "\n";
        echo $TAB, $HTAB, "Display usage information for a specific command.";
        echo "\n";
        echo "\n";
    }