Repository navigation
Conversation
|
Tbh for changes like this I would really prefer we have a fixture for each of bash/zsh/fish with:
That would allow us to verify the end user experience is what we expect. |
|
Added interactive fixtures using the existing All 9 cases pass locally; the original scripts fail the 6 omitted-default cases. The README includes the command to reproduce this without Python dependencies. I also updated the three dump-help/manual snapshots missed when switching to the inferred default command name, which caused the CI failures. The full Swift Testing suite remains unavailable on my Command Line Tools-only host, so I haven't claimed a local full-suite pass. The example and manual generator build successfully. |
|
this is very cool, though for the harness to be a good citizen in this repo it would be preferable for the tests to run via swift-testing |
|
Added All nine cases passed through Swift Testing in an isolated build using the package-generated resource accessor. The full package suite is still blocked locally by missing XCTest in my Command Line Tools installation. I also fixed the license header and Python lint failures from CI. |
9feafa3 to
bac1883
Compare
Adds a default subcommand's named arguments to its parent command's generated completions, so options and flags remain completable when the default subcommand name is omitted.
The completion metadata retains the owning subcommand for custom completion callbacks and removes duplicate option names inherited through nested defaults. Positional arguments are intentionally not merged because they would compete with explicit subcommand names.
Fixes #488.
Checklist
Testing
Tests/ArgumentParserExampleTests/CompletionTestscontains command-line/Tab/output fixtures using the existingMath → Addhierarchy. All 9 real-shell cases pass with bash, zsh and fish; the original scripts fail the 6 omitted-default cases. The runner uses Python's standard library and a PTY; its README includes the reproduction command.mathandgenerate-manualbuild successfully. The three dump-help/manual snapshot changes correspond to the inferreddefaultSubcommand: addmetadata and the now-optional subcommand in the synopsis.CompletionExampleTestsregisters all shell/fixture pairs with Swift Testing and reports driver failures as test failures. All nine cases passed through the actual Swift Testing entry point in an isolated build with the package-generated resource accessor. The full package suite remains blocked locally by missing XCTest in this Command Line Tools-only installation; the repository CI matrix must validate it.AI assistance: Codex was used to investigate the issue, implement the change, and draft tests and this PR description. I reviewed the diff and verified the behavior described above.