Overview

Namespaces

  • Webmozart
    • Console
      • Adapter
      • Api
        • Application
        • Args
          • Format
        • Command
        • Config
        • Event
        • Formatter
        • IO
        • Resolver
      • Args
      • Config
      • Formatter
      • Handler
        • Help
      • IO
        • InputStream
        • OutputStream
      • Process
      • Resolver
      • UI
        • Alignment
        • Component
        • Help
        • Layout
        • Style
      • Util

Classes

  • AbstractOption
  • ArgsFormat
  • ArgsFormatBuilder
  • Argument
  • CommandName
  • CommandOption
  • Option

Exceptions

  • InvalidValueException
  • Overview
  • Namespace
  • Class

Class CommandOption

A command option in the console arguments.

The command names and command options determine which command is executed.

In the example below, the console arguments contain the command name "server" and the command option "delete":

$ console server --delete localhost
$ console server -d localhost

The last part "localhost" is the argument to the "server --delete" command.

Webmozart\Console\Api\Args\Format\AbstractOption
Extended by Webmozart\Console\Api\Args\Format\CommandOption
Namespace: Webmozart\Console\Api\Args\Format
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
See: Webmozart\Console\Api\Args\Format\CommandName, Webmozart\Console\Api\Args\Format\ArgsFormat
Located at Api/Args/Format/CommandOption.php
Methods summary
public
# __construct( string $longName, string|null $shortName = null, array $aliases = array(), integer $flags = 0, string $description = null )

Creates the command option.

Creates the command option.

Parameters

$longName
The long option name.
$shortName
The short option name.
$aliases
A list of alias names.
$flags

A bitwise combination of the option flag constants.

$description
A human-readable description of the option.

Throws

Webmozart\Console\Api\Args\Format\InvalidValueException
If the default value is invalid.

Overrides

Webmozart\Console\Api\Args\Format\AbstractOption::__construct()
public string[]
# getLongAliases( )

Returns all long alias names.

Returns all long alias names.

Returns

string[]
The long alias names.
public string[]
# getShortAliases( )

Returns all short alias names.

Returns all short alias names.

Returns

string[]
The short alias names.
Methods inherited from Webmozart\Console\Api\Args\Format\AbstractOption
getDescription(), getLongName(), getShortName(), isLongNamePreferred(), isShortNamePreferred()
Constants inherited from Webmozart\Console\Api\Args\Format\AbstractOption
PREFER_LONG_NAME, PREFER_SHORT_NAME
Properties inherited from Webmozart\Console\Api\Args\Format\AbstractOption
$flags
Webmozart Console API API documentation generated by ApiGen