Skip to content

Commit

Permalink
Merge pull request #157 from aik099/group-config-settings-feat
Browse files Browse the repository at this point in the history
Group config settings by a command
  • Loading branch information
aik099 committed Aug 20, 2024
2 parents 92f8184 + 256be3e commit 1764e11
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Binary file modified docs/images/SvnBuddy_ConfigCommand_ShowAllSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/SVNBuddy/Command/ConfigCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1764e11

Please sign in to comment.