Skip to content

Commit 621f991

Browse files
committed
[TwigBridge] Cleaned documentation of twig:lint command
1 parent 4ad343b commit 621f991

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,20 @@ protected function configure()
5858
->setDescription('Lints a template and outputs encountered errors')
5959
->addArgument('filename')
6060
->setHelp(<<<EOF
61-
The <info>%command.name%</info> command lints a template and outputs to stdout
61+
The <info>%command.name%</info> command lints a template and outputs to STDOUT
6262
the first encountered syntax error.
6363
64+
You can validate the syntax of a file:
65+
6466
<info>php %command.full_name% filename</info>
6567
66-
The command gets the contents of <comment>filename</comment> and validates its syntax.
68+
Or of a whole directory:
6769
6870
<info>php %command.full_name% dirname</info>
6971
70-
The command finds all twig templates in <comment>dirname</comment> and validates the syntax
71-
of each Twig template.
72+
You can also pass the template contents from STDIN:
7273
7374
<info>cat filename | php %command.full_name%</info>
74-
75-
The command gets the template contents from stdin and validates its syntax.
7675
EOF
7776
)
7877
;
@@ -86,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8685

8786
if (!$filename) {
8887
if (0 !== ftell(STDIN)) {
89-
throw new \RuntimeException("Please provide a filename or pipe template content to stdin.");
88+
throw new \RuntimeException("Please provide a filename or pipe template content to STDIN.");
9089
}
9190

9291
while (!feof(STDIN)) {

src/Symfony/Bundle/TwigBundle/Command/LintCommand.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ protected function configure()
5757
$this->getHelp().<<<EOF
5858
5959
60-
<info>php %command.full_name% @AcmeMyBundle</info>
60+
Or all template files in a bundle:
6161
62-
The command finds all twig templates in the <comment>AcmeMyBundle</comment> bundle and validates
63-
the syntax of each Twig template.
62+
<info>php %command.full_name% @AcmeDemoBundle</info>
6463
EOF
6564
)
6665
;

0 commit comments

Comments
 (0)