but: removed num_args from --changes#12223
Conversation
|
@rsteube is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
|
hey @rsteube the idea for this was to be able to do |
|
@krlvi but commit --changes fileA,fileB
but commit --changes fileA --changes fileBI think Some ideas below. Use positional arguments for changes/target: # but commit [change]... target
but commit branch
but commit fileA branch
but commit fileA fileB branchIn the completions both changes and branches would appear for each position though. Invert the usage of flags: # but commit [-t target] [change]...
but commit -t branch
but commit -t branch fileA
but commit -t branch fileA fileBUse a bool flag to modify the behaviour of parsing positional arguments (as in 1). Explicitly use dash args for files. # but commit [target] [-- change...]
but commit branch
but commit branch -- fileA
but commit branch -- fileA fileB
but commit -- fileA fileB |
This consumes multiple args until another flag is encountered. Thus mininterprets a following positional argument (branch) as change unless separated with dash `--`. see https://docs.rs/clap/latest/clap/struct.Arg.html#method.num_args
krlvi
left a comment
There was a problem hiding this comment.
Okay now i understand the considerations. Thank you for this contribution
🧢 Changes
Removed
num_args.☕️ Reasoning
This consumes multiple args until another flag is encountered. Thus mininterprets a following positional argument (branch) as change unless separated with dash
--.see https://docs.rs/clap/latest/clap/struct.Arg.html#method.num_args