-
Notifications
You must be signed in to change notification settings - Fork 379
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
fix(cli): accept flags after command's arguments #762
Conversation
9a0356a
to
cfd08bd
Compare
Looks nice, and the first step going in the direction of #731. Please, fix the CI, and I'll give a round of review. |
22febe2
to
8aa9768
Compare
@moul I fixed the linter, but it seems I'm facing the port already in use problem. Can you rerun the test, I don't have that permission.
|
diff between this and ffcli source: https://www.diffchecker.com/dtnUgZU6/ |
Co-authored-by: Morgan <[email protected]>
- call ff.Parse a single time - remove goto - add more test cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe all gno CLI users will breathe a sigh of relief after we merge this out 🙂
Thank you for adding these changes, and for being thorough in the PR description / comments 🙏
@tbruyelle can you rebase and fix conflicts? then we can merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love this, Parse
logic is clear and made me convinced it worked correctly without even seeing the tests, great job on the refactor
Conflicts fixed. |
Addresses #731
Description
This change allows to pass flags after a command's argument. This regression was added with the latest cli refactor that introduced the
peterbourgon/ff/v3/ffcli
library for command and flag parsing.This change doesn't remove or replace
ffcli
, but instead suggest the minimal change to support flags after command's arguments. For thatffcli
is forked insidetm2/pkg/commands/ffcli
, and patched to support this feature.The first commit just forks
ffcli
, while the second contains the patch, so I suggest to focus the review on this one.Tests
Before that change, it was not possible to execute this command, because the
-remote
flags was expected before theauth/accounts/g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5
query argument.Additional notes
I wanted to bring the minimal change, but maybe it's better to merge the forked
ffcli
and our legacycommands
package to have a better code. Anyway this PR can be used as a preliminary work for a wider refactor.