diff --git a/CHANGELOG.md b/CHANGELOG.md index b76dfad..f5ca0f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added `--deploy` option to the `update` command, that will perform a local deployment after a successful update. ### Changed -... +- The `config` command groups configuration settings by a command. ### Fixed - The non-merged revision table was shown after a successful auto-commit, when merge conflict was resolved. diff --git a/README.md b/README.md index 9c938b5..f06ecf9 100755 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Feel free to add `--global` option to any of examples below to operate on global svn-buddy.phar config ``` -Shows values of all settings in current working copy: +Shows values of all settings in current working copy grouped by a command: ![all working copy settings](docs/images/SvnBuddy_ConfigCommand_ShowAllSettings.png) diff --git a/docs/images/SvnBuddy_ConfigCommand_ShowAllSettings.png b/docs/images/SvnBuddy_ConfigCommand_ShowAllSettings.png index a639df0..f596d88 100644 Binary files a/docs/images/SvnBuddy_ConfigCommand_ShowAllSettings.png and b/docs/images/SvnBuddy_ConfigCommand_ShowAllSettings.png differ diff --git a/src/SVNBuddy/Command/ConfigCommand.php b/src/SVNBuddy/Command/ConfigCommand.php index 247bb56..4f29280 100644 --- a/src/SVNBuddy/Command/ConfigCommand.php +++ b/src/SVNBuddy/Command/ConfigCommand.php @@ -18,6 +18,7 @@ use ConsoleHelpers\SVNBuddy\InteractiveEditor; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Helper\TableSeparator; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -275,15 +276,25 @@ protected function listSettings($setting_name = null) $value_filter = $this->getValueFilter(); + $prev_heading = null; + foreach ( $this->getConfigSettingsByScope($this->getScopeFilter()) as $name => $config_setting ) { if ( isset($setting_name) && $name !== $setting_name ) { continue; } + list($new_heading,) = explode('.', $name); + + if ( $prev_heading !== null && $new_heading !== $prev_heading ) { + $table->addRow(new TableSeparator()); + } + $table->addRow(array( $name, var_export($config_setting->getValue($value_filter), true), )); + + $prev_heading = $new_heading; } $table->render();