Skip to content
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

Command flags after arguments are discarded without warning #183

Closed
qmuntal opened this issue May 26, 2022 · 4 comments · Fixed by #250 or #255
Closed

Command flags after arguments are discarded without warning #183

qmuntal opened this issue May 26, 2022 · 4 comments · Fixed by #250 or #255
Assignees
Labels
bug Something isn't working supportability Need support from the community
Milestone

Comments

@qmuntal
Copy link
Contributor

qmuntal commented May 26, 2022

Several folks and I have been hit by this issue:

  • notation sign --key=$KEY_NAME $IMAGE works
  • notation sign $IMAGE --key=$KEY_NAME does not works and errors out with signing key not found.

The same problem applies to any non-required flag which is used together with an argument, i.e. -p/-u.

Using flags after arguments seems not to be supported by urfave/cli, see urfave/cli#976.

We should at least error early with a meaningful message instead of executing the normal workflow and having a random error message.

@dtzar

@SteveLasker
Copy link
Contributor

+1. I realize the positional parameter shouldn’t have named parameters after.
I like the idea of an error, not even a warning.

@qmuntal qmuntal changed the title Command flags after arguments are without warning Command flags after arguments are discarded without warning Jun 3, 2022
@dtzar dtzar added this to the RC-1 milestone Jun 29, 2022
@dtzar dtzar added the bug Something isn't working label Jun 29, 2022
@shizhMSFT
Copy link
Contributor

Let's move to github.com/spf13/cobra.

@chloeyin
Copy link
Contributor

chloeyin commented Jul 5, 2022

Let's move to github.com/spf13/cobra.

I will take a look at it.

@dtzar
Copy link
Contributor

dtzar commented Jul 5, 2022

Yes, this would be great! It would also help with the user experience because of the autogenerated help and man pages.

@dtzar dtzar added the supportability Need support from the community label Jul 11, 2022
This was referenced Jul 15, 2022
@dtzar dtzar modified the milestones: RC-1, alpha-3 Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working supportability Need support from the community
Projects
Status: Done
5 participants