Escape command usage when displaying it in the text descriptor

This commit is contained in:
Samuel ROZE 2017-10-06 09:50:51 +01:00
parent dd490af864
commit 2141056471
No known key found for this signature in database
GPG Key ID: 835426F55A19FB84
3 changed files with 7 additions and 7 deletions

View File

@ -143,7 +143,7 @@ class TextDescriptor extends Descriptor
$this->writeText('<comment>Usage:</comment>', $options);
foreach (array_merge(array($command->getSynopsis(true)), $command->getAliases(), $command->getUsages()) as $usage) {
$this->writeText("\n");
$this->writeText(' '.$usage, $options);
$this->writeText(' '.OutputFormatter::escape($usage), $options);
}
$this->writeText("\n");

View File

@ -1,7 +1,7 @@
<comment>Usage:</comment>
descriptor:command2 [options] [--] <argument_name>
descriptor:command2 -o|--option_name <argument_name>
descriptor:command2 <argument_name>
descriptor:command2 [options] [--] \<argument_name>
descriptor:command2 -o|--option_name \<argument_name>
descriptor:command2 \<argument_name>
<comment>Arguments:</comment>
<info>argument_name</info>

View File

@ -1,7 +1,7 @@
<comment>Usage:</comment>
descriptor:åèä [options] [--] <argument_åèä>
descriptor:åèä -o|--option_name <argument_name>
descriptor:åèä <argument_name>
descriptor:åèä [options] [--] \<argument_åèä>
descriptor:åèä -o|--option_name \<argument_name>
descriptor:åèä \<argument_name>
<comment>Arguments:</comment>
<info>argument_åèä</info>