Update move command to accept standard mv args#173
Conversation
Co-authored-by: martin.emde <martin.emde@gusto.com>
|
Cursor Agent can help with this pull request. Just |
|
@cursor Make sure sorbet passes: |
|
Fixed the Sorbet type errors by adding The changes:
This satisfies Sorbet's type checker while preserving the logic. The linter shows no errors, and the type checks should pass in CI. Learn more about Cursor Agents |
Co-authored-by: martin.emde <martin.emde@gusto.com>
ivy
left a comment
There was a problem hiding this comment.
Thoughts about deprecating move and making an mv subcommand? I think that would further reinforce the argument order by following Unix conventions.
dduugg
left a comment
There was a problem hiding this comment.
Thanks for this — the new argument order is more intuitive and aligns nicely with mv.
A few things worth noting before merging:
Breaking change
This is a backwards-incompatible CLI change. Anyone with scripts or tooling using the old destination first order will silently misbehave — their first arg becomes a source path and their last becomes the destination pack. No deprecation warning or migration path is provided. Worth calling this out explicitly and checking the version bump checklist item.
No spec updates visible
There are no test changes in the diff. Existing specs that call move with the old argument order would now be broken. Can you confirm tests pass with the new order, or point to where coverage lives?
StandardError type
Raising StandardError directly prints a backtrace for a user-facing CLI error. Thor::Error (or whatever the existing pattern is in this codebase) would give a cleaner error message without the noise.
Redundant T.must calls
T.must(paths) is unnecessary — a splat result is always an Array, never nil. T.must(pack_name) is also redundant given the args.length < 2 guard above already ensures pack_name is non-nil. Both are harmless but worth cleaning up.
Error message could be more helpful
The current message — 'At least two arguments required: source path(s) and destination pack' — doesn't show the actual usage. Something like Usage: packs move path/to/file.rb [more/paths...] packs/destination would make it easier to self-correct.
Aligns the
bin/packs movecommand's argument order with the standardmvutility.The command now accepts arguments as
sources... destination(last argument is the destination pack), making it more intuitive and consistent with common CLI patterns.Slack Thread