8000 bug #18556 [FrameworkBundle] Better output for user in ContainerDebug… · symfony/symfony@2a47edc · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a47edc

Browse files
bug #18556 [FrameworkBundle] Better output for user in ContainerDebugCommand (JhonnyL)
This PR was merged into the 3.0 branch. Discussion ---------- [FrameworkBundle] Better output for user in ContainerDebugCommand | Q | A | ------------- | --- | Branch? | 3.0 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Right now, the message `To search for a specific service, re-run this command with a search term. (e.g. debug:container log)` is displayed to the user whenever the command is being run. (Except when the search term is given). But if a user runs e.g. `debug:container --parameters`. This message is out of scope since the user is looking for information about parameters, not services. This PR will update the command to give better output to the user. `debug:container` Will keep current behaviour `debug:container --parameters` Will hint how to search for specific parameter `debug:container --tags` Will hint how to search for specific tag Commits ------- 313d8b1 [FrameworkBundle] Better output for user in ContainerDebugCommand
2 parents 76f3eae + 313d8b1 commit 2a47edc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
121121
$options['output'] = $io;
122122
$helper->describe($output, $object, $options);
123123

124-
if (!$input->getArgument('name') && $input->isInteractive()) {
125-
$io->comment('To search for a specific service, re-run this command with a search term. (e.g. <comment>debug:container log</comment>)');
124+
if (!$input->getArgument('name') && !$input->getOption('tag') && !$input->getOption('parameter') && $input->isInteractive()) {
125+
if ($input->getOption('tags')) {
126+
$io->comment('To search for a specific tag, re-run this command with a search term. (e.g. <comment>debug:container --tag=form.type</comment>)');
127+
} elseif ($input->getOption('parameters')) {
128+
$io->comment('To search for a specific parameter, re-run this command with a search term. (e.g. <comment>debug:container --parameter=kernel.debug</comment>)');
129+
} else {
130+
$io->comment('To search for a specific service, re-run this command with a search term. (e.g. <comment>debug:container log</comment>)');
131+
}
126132
}
127133
}
128134

0 commit comments

Comments
 (0)
0