Argument
class Argument extends Alvine
Argument
Ein Argument kann beim aufruf einer Komandozeilenanwendung nach dem Dateinamen angegeben werden.
$arg = new \Alvine\Application\Console\Argument('myCommand');
$arg->onMatch = function($obj, $cmd, $options) {
// ... mache etwas mit $cmd und $options
};
$arg->setDescription('Mein Befehl');
Constants
GLOBALKEY |
Name für globale Optionen |
Properties
protected string | $name | ||
protected boolean | $required | ||
protected string | $description | ||
protected type | $option | ||
protected type | $position |
Methods
Neues Terminal-Objekt
Position
Position
Position
Beschreibung
Beschreibung
Name
Erforderlich
Erforderlich
Wert
Zeichenkette
Details
at line 94
__construct(string $name)
Neues Terminal-Objekt
Für globale Befehle, muss der Name für Argument::GLOBALKEY sein
at line 122
boolean
hasPosition()
Position
at line 133
Argument
setPosition(integer $position)
Position
at line 143
integer
getPosition()
Position
at line 167
Argument
execute(StringList $options = null, StringList $global = null)
Execute
Ausführen eines Arguments und Aufruf der Argument::onMatch() Methode.
(new \Alvine\Application\Console\Argument('addnode'))->onMatch
= function(Alvine\Application\Console\Argument $argument, // Argument
\Alvine\Types\StringList $options, // übergebene Optionen
\Alvine\Types\StringList $global) { // übergebene Gloabloptionen
// ... mach was ...
}
at line 192
Argument
setDescription(string $description)
Beschreibung
at line 202
string
getDescription()
Beschreibung
at line 211
string
getName()
Name
at line 222
Argument
setRequired(boolean $flag = true)
Erforderlich
at line 232
boolean
isRequired()
Erforderlich
at line 243
string
validate(string $value)
Wert
at line 256
string
__toString()
Zeichenkette
Ausgabe des Arguments als Hilfetext mit allen Informationen