Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group config settings by a command #157

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading