You are here

protected function LintCommand::configure in Lockr 7.3

File

vendor/symfony/yaml/Command/LintCommand.php, line 52

Class

LintCommand
Validates YAML files syntax and outputs encountered errors.

Namespace

Symfony\Component\Yaml\Command

Code

protected function configure() {
  $this
    ->setDescription('Lints a file and outputs encountered errors')
    ->addArgument('filename', null, 'A file or a directory or STDIN')
    ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')
    ->addOption('parse-tags', null, InputOption::VALUE_NONE, 'Parse custom tags')
    ->setHelp(<<<EOF
The <info>%command.name%</info> command lints a YAML file and outputs to STDOUT
the first encountered syntax error.

You can validates YAML contents passed from STDIN:

  <info>cat filename | php %command.full_name%</info>

You can also validate the syntax of a file:

  <info>php %command.full_name% filename</info>

Or of a whole directory:

  <info>php %command.full_name% dirname</info>
  <info>php %command.full_name% dirname --format=json</info>

EOF
);
}