Platformsh\Cli\Util\Table::addFormatOption PHP Method

addFormatOption() public static method

Add the --format option to a command's input definition.
public static addFormatOption ( Symfony\Component\Console\Input\InputDefinition $definition )
$definition Symfony\Component\Console\Input\InputDefinition
    public static function addFormatOption(InputDefinition $definition)
    {
        $description = 'The output format ("table", "csv", or "tsv")';
        $option = new InputOption('format', null, InputOption::VALUE_REQUIRED, $description, 'table');
        $definition->addOption($option);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 protected function configure()
 {
     $this->setName('domain:get')->setDescription('Show detailed information for a domain')->addArgument('name', InputArgument::OPTIONAL, 'The domain name')->addOption('property', 'P', InputOption::VALUE_REQUIRED, 'The domain property to view');
     Table::addFormatOption($this->getDefinition());
     PropertyFormatter::configureInput($this->getDefinition());
     $this->addProjectOption();
 }
All Usage Examples Of Platformsh\Cli\Util\Table::addFormatOption