prevent using a file and arguments at the same time#80
Merged
jakecoffman merged 1 commit intomainfrom Mar 22, 2023
Merged
Conversation
jeffwidman
reviewed
Mar 22, 2023
|
|
||
| if file != "" { | ||
| if len(cmd.Flags().Args()) > 0 { | ||
| return errors.New("cannot use file and arguments together") |
Member
There was a problem hiding this comment.
Since we're using cobra, is there a reason you didn't use the MarkFlagsMutuallyExclusive option?
My guess is that'd also add some useful output in the help command so it wouldn't have to be manually mentioned like you did in line 30...
Docs here: https://github.com/spf13/cobra/blob/main/user_guide.md
Member
Author
There was a problem hiding this comment.
Since the params are arguments and not flags I think that won't work.
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.
It's currently possible to do
dependabot update bundler my/repo -f input.ymlwhich is not clear what should happen.When you run as
dependabot update bundler my/repothis is a convenience to get started with Dependabot CLI. Not every option maps to a flag though, so most of the time you end up with an input filedependabot update -f input.yml. Mixing the two is not intended to be a feature.This PR prevents using the two together. I also cleaned up the usage output and added an example.