@@ -41,14 +41,17 @@ class ConfigDebugCommand extends AbstractConfigCommand
41
41
{
42
42
protected function configure ()
43
43
{
44
+ $ commentedHelpFormats = array_map (static fn (string $ format ): string => sprintf ('<comment>%s</comment> ' , $ format ), $ this ->getAvailableFormatOptions ());
45
+ $ helpFormats = implode ('", " ' , $ commentedHelpFormats );
46
+
44
47
$ this
45
48
->setDefinition ([
46
49
new InputArgument ('name ' , InputArgument::OPTIONAL , 'The bundle name or the extension alias ' ),
47
50
new InputArgument ('path ' , InputArgument::OPTIONAL , 'The configuration option path ' ),
48
51
new InputOption ('resolve-env ' , null , InputOption::VALUE_NONE , 'Display resolved environment variable values instead of placeholders ' ),
49
52
new InputOption ('format ' , null , InputOption::VALUE_REQUIRED , sprintf ('The output format ("%s") ' , implode ('", " ' , $ this ->getAvailableFormatOptions ())), class_exists (Yaml::class) ? 'yaml ' : 'json ' ),
50
53
])
51
- ->setHelp (<<<' EOF'
54
+ ->setHelp (<<<EOF
52
55
The <info>%command.name%</info> command dumps the current configuration for an
53
56
extension/bundle.
54
57
@@ -58,16 +61,17 @@ protected function configure()
58
61
<info>php %command.full_name% FrameworkBundle</info>
59
62
60
63
The <info>--format</info> option specifies the format of the configuration,
61
- this is either <comment>yaml</comment> or <comment>json</comment> .
64
+ this is either " { $ helpFormats } " .
62
65
63
- <info>php %command.full_name% FrameworkBundle --format=json</info>
66
+ <info>php %command.full_name% framework --format=json</info>
64
67
65
68
For dumping a specific option, add its path as second argument:
66
69
67
70
<info>php %command.full_name% framework serializer.enabled</info>
68
71
69
72
EOF
70
- );
73
+ )
74
+ ;
71
75
}
72
76
73
77
protected function execute (InputInterface $ input , OutputInterface $ output ): int
0 commit comments