-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Refactor cli to use clap’s derive. #1228
Conversation
This turns out to be a bit more complicated. We will implement this in a separate PR.
The new client code percent-encodes handles that contain slashes. However, the server will reject those in API paths as it doesn’t do percent-decoding. However, it can’t properly deal with such handles, anyway, which will need fixing in a separate PR. |
I see that the new Also I see that the old code sorts command line subcommands alphabetically, whereas now they are grouped and ordered deliberately. Are these deliberate changes? |
I note that error messages no longer contain tips, e.g. Old:
New:
Is this a deliberate change? |
The text printed for Old:
New:
Various command line arguments are no longer shown, with Update: This is made worse by the error message when a user puts the argument in the old position by accident: New:
The issue here is NOT the lack of New:
|
One other thing I don't get, though I'm not sure that this is caused by this PR, is that the
But it doesn't work via the Old:
New:
Update: Ah, I see why, but this is confusing:
Why does |
There seems to be an exit code regression: Old:
New:
|
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've done a partial review, will continue reviewing next week.
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 played with the CLI in a shell, I read most if not all of the actual changed client/server code, and I scanned the modified tests to see if they looked structurally roughly the same as the originals. I did NOT try and work out if the encode()
HTTP path percent encoding is correct as I need more coffee or something before I can make sense of RFC 3986. I'll approve this PR with the assumption that the comments I made will be checked. Nice cleanup by the way!
Regarding the changes to the help output: I suppose they are the price for using the derive model. We could probably try and work around some of them, but I’m not sure whether the krillc is used widely enough to make this worthwhile. |
Not sure. I will leave it like it is for now, though. |
This was my bad, this behaviour wasn't introduced by this PR. |
Nice find! Someone mixed up the two cases … |
This PR changes how the clients –
krillc
,krillta
, as well as the integration tests – work to better fit the derive model provided by clap. This results in basically everything in thecli
module and all the integration tests being different now.The PR slightly changes the options for both
krillc
andkrillta
. Forkrillc
, the--server
,--token
,--format
, and--api
options are now before the first subcommand (since they affect all commands). Forkrillta
, those options are now afterkrillta proxy
but before the next subcommand, while--format
is now afterkrillta signer
.This PR also removes client support and integration tests for RTA.
This is a breaking change.