Repository navigation
Stop treating command-line options as GitHub user names - #59
Merged
Merged
Conversation
Add -h/--help, report any other hyphen-prefixed argument as an unknown option with exit status 2 before anything is backed up, and leave --name=value property overrides to Spring instead of also reporting them as a failed user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric, scored against the diff at
Notes:
No FAIL item remains. No review from Copilot could be requested, because the reviewer is not configured on this repository, and no other review comment had been posted. This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-hand--helpare now handled as options: the usage message is printed, status0is returned, and GitHub is not contacted. Previously--helpwas looked up as a user, and status1was returned when the lookup failed.Error: Unknown option: <arg>, with the usage message written to standard error. Nothing is backed up, and the new status2is returned, so that a command-line mistake can be told apart from a failed backup.--<property>=<value>argument, which has already been applied by Spring by that point, is no longer also reported as a failed user.COMMANDS.md,CONFIG.md,USER_GUIDE.mdandCHANGELOG.mdhave been updated, and a2row has been added to the Exit Status table.Behaviour changes worth checking
octocat -i,octocatwas previously backed up and a failure was then reported for a user named-i. Nothing is backed up now and status2is returned, because arguments are checked before the first backup is started. Backups of the valid names in a scheduled command with a stray option are therefore stopped, although status1was already being returned for that command.testRun_InteractiveFlagNotFirst_TreatedAsUserNamepinned the old behaviour and has been rewritten astestRun_InteractiveFlagNotFirst_RejectedAsUnknownOption.--<property>=<value>is deliberately not rejected, since a backup that is run that way today would otherwise be stopped. As a result, a mistyped property name is silently ignored.backup-completedusage event is sent for an unknown-option or--helprun, because no backup was run.Test plan
mvn -B -o package: 204 tests were run, with 0 failures, 0 errors and 1 skippedSpringApplication.exitbytestExitStatus_UnknownOptionReachesSpringApplicationExit. A manual check is recommended: the JAR should be run with--bogusand$?read, and--backup.directory=<path> octocatshould be confirmed to write to that path.Closes #58
Skipped issues
#8 (missing
LICENSE) remains deferred: the license text, copyright holder and year have to be chosen by the maintainer.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code