Add short option aliases for CLI commands#140
Merged
Conversation
Add -t (--template-name), -p (--project-path), and -g (--include-git-files) short aliases following Unix conventions. Update man page documentation and add convention test to ensure future options include short aliases. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the approach of using reflection-based unit tests to enforce Cocona conventions. Move code examples from CLAUDE.md to the new how-to guide and update cross-references. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR enhances CLI usability by adding Unix-style short option aliases (-t, -p, -g) to command options, making commands more concise while maintaining backward compatibility with long-form options.
Changes:
- Added short aliases to
newcommand options andproject switch-templateoption - Updated man page documentation to reflect both short and long option forms
- Introduced convention test to enforce short aliases on all future options
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Keystone.Cli/Presentation/NewCommandController.cs | Added short aliases -t, -p, -g to new command options |
| src/Keystone.Cli/Presentation/Project/SwitchTemplateSubCommand.cs | Added short alias -p to switch-template command option |
| tests/Keystone.Cli.UnitTests/Presentation/Cocona/CoconaCommandMethodConventionsTests.cs | Added convention test enforcing short aliases on all option parameters |
| docs/man/man1/keystone-cli.1 | Updated man page synopsis, options, and examples to show short+long forms |
| docs/how-to/how-to-convention-tests.md | Added documentation explaining convention testing approach |
| CLAUDE.md | Updated project documentation to reference new convention test guide |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Improve CLI usability by adding short option aliases following Unix conventions. Users can now use
-t,-p, and-ginstead of the longer--template-name,--project-path, and--include-git-filesoptions, reducing typing and aligning with user expectations.Related Issues
Fixes #116
Changes
newcommand options (-t,-p,-g)project switch-templateoption (-p)docs/how-to/how-to-convention-tests.md