You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): make packages argument required for add/remove commands (#277)
### TL;DR
Make package arguments required for `add` and `remove` commands in the CLI.
### What changed?
- Added the `required = true` attribute to the `packages` argument in both `add` and `remove` commands
- Removed the `NoPackagesSpecified` error from the error enum as it's no longer needed
- Removed validation code that checked for empty packages in the `add` and `remove` command implementations
- Removed tests that were checking the empty packages case
- Updated snap tests to reflect the new required argument behavior
- Updated command help text in snap tests to show packages as required (`<PACKAGES>...` instead of `[PACKAGES]...`)
- Added a new test case to verify the error when no packages are specified
### How to test?
1. Run `vp add` without any packages and verify it shows an error about missing required arguments
2. Run `vp remove` without any packages and verify it shows an error about missing required arguments
3. Run the snap tests to verify the updated behavior
### Why make this change?
This change improves the CLI interface by making it clearer that package names are required for both `add` and `remove` commands. By using Clap's built-in argument validation instead of custom error handling, we get more consistent error messages and better help text. This also simplifies the code by removing unnecessary validation logic and error types.
0 commit comments