-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add positional arguments support to get commands #489
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
feat: add positional arguments support to get commands #489
Conversation
ac5d7b6 to
2dd0759
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds positional argument support to get commands for variables, features, and environments, allowing users to specify keys as space-separated or comma-separated arguments instead of only using the --keys flag.
- Added a shared utility function
parseKeysFromArgsto handle argument parsing with proper precedence - Updated three get commands to support positional arguments while maintaining backward compatibility
- Added comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/utils/parseKeysFromArgs.ts |
New utility function for parsing keys from various argument formats |
src/utils/parseKeysFromArgs.test.ts |
Test coverage for the utility function |
src/commands/variables/get.ts |
Updated to support positional arguments and new examples |
src/commands/variables/get.test.ts |
Added test for positional argument functionality |
src/commands/features/get.ts |
Updated to support positional arguments and new examples |
src/commands/features/get.test.ts |
Added test for positional argument functionality |
src/commands/environments/get.ts |
Updated to support positional arguments and new examples |
src/commands/environments/get.test.ts |
New test file with comprehensive test coverage |
oclif.manifest.json |
Updated manifest with new command configurations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
|
|
||
| if (args.keys) { | ||
| // Handle the first positional argument if provided |
Copilot
AI
Aug 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is misleading. The code handles args.keys which is not necessarily the first positional argument, but rather a named argument. Consider updating the comment to accurately reflect what this code does.
| // Handle the first positional argument if provided | |
| // Handle the named argument 'keys' if provided |
Add positional arguments support to get commands
Implements FDN-561 to allow positional arguments as shorthand for the
--keysflag in get commands.What's Changed
Added support for positional arguments in:
dvc variables getdvc features getdvc environments getNew Usage Patterns
Key Features
✅ Backward compatible - existing
--keysflag usage unchanged✅ Precedence handling - positional args take priority over
--keys✅ Flexible input - supports both space and comma separation
✅ Updated help - new examples in command documentation
✅ DRY implementation - shared utility function for consistency
Testing