Skip to content

Commit 036a529

Browse files
author
Alexander Obuhovich
committed
The "aggregate" command now doesn't require sub-command, when "--ignore-*" options are used
1 parent ef01b1c commit 036a529

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3939
- Wrap list of associated revision next to conflicted paths to "4 per row" to avoid too wide table creation.
4040
- Name format of per-working copy config setting is changed, which will result in all data being lost unless migrated by hand in "~/.svn-buddy/config.json" file (old "path-settings.wc_url_hash.setting_name", new: "path-settings[wc_url].setting_name").
4141
- Major under the hood revision information storage changes.
42+
- The `aggregate` command no longer requires specifying `sub-command` argument, when `--ignore-*` options are used.
4243

4344
### Fixed
4445
- The Subversion repositories hosted on https://unfuddle.com/ were not usable from `log` and `merge` commands.

src/SVNBuddy/Command/AggregateCommand.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function configure()
3737
)
3838
->addArgument(
3939
'sub-command',
40-
InputArgument::REQUIRED,
40+
InputArgument::OPTIONAL,
4141
'Command to execute on each found working copy'
4242
)
4343
->addArgument(
@@ -122,18 +122,22 @@ protected function getSubCommands()
122122
*/
123123
protected function execute(InputInterface $input, OutputInterface $output)
124124
{
125+
if ( $this->processIgnoreAdd() || $this->processIgnoreRemove() || $this->processIgnoreShow() ) {
126+
return;
127+
}
128+
125129
$sub_command = $this->io->getArgument('sub-command');
126130

131+
if ( $sub_command === null ) {
132+
throw new \RuntimeException('Not enough arguments (missing: "sub-command").');
133+
}
134+
127135
if ( !in_array($sub_command, $this->getSubCommands()) ) {
128136
throw new \RuntimeException(
129137
'The "' . $sub_command . '" sub-command is unknown or doesn\'t support aggregation.'
130138
);
131139
}
132140

133-
if ( $this->processIgnoreAdd() || $this->processIgnoreRemove() || $this->processIgnoreShow() ) {
134-
return;
135-
}
136-
137141
$this->runSubCommand($sub_command);
138142
}
139143

0 commit comments

Comments
 (0)