-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Port cmd/fyne to using urfave/cli #1858
Conversation
I really don't like single dash command arguments In fact, it makes single dash arguments "not chainable", which is pretty dumb. (see: any *nix command ever: Which brings me to the point of that rant:
Those were the only real real features that cobra provided over any other cli impl. (Well, that and viper integration.) Alright, review done, I'm sorry, haha. |
&cli.StringFlag{ | ||
Name: "target", | ||
Aliases: []string{"os"}, | ||
Usage: "The operating system to target (android, android/arm, android/arm64, android/amd64, android/386, darwin, freebsd, ios, linux, netbsd, openbsd, windows)", |
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.
What is android
v.s android/386
? Is that practically android/arm386
?
Also, where did 32-bit BSD, Linux and Windows go?
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.
We probably shouldn't list all of possible values in the usage. The list we have is way too long.
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.
Makes sense. If extended helps comes up somewhere, we could link an FAQ or developer.fyne page that has information on building, or lists architectures.
Is there any way we can test that this change is backward compatible? |
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 what I'm seeing :) New changes look great.
Also good to know I'm now the only one using spew.Dump()
to debug :P
Thanks. I don't use |
I got that from the |
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 think a few changes like re-ordering and doc removal need to be reversed.
The main problem here is that we have a new public API that is exposing 3rd party CLI interface types instead of our own. This is something we try to avoid, the solution may need some more thinking.
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.
Overall this is looking good - sorry it has been so much work!
There is a problem - as far as I can see NewGetter
has been removed from the public API.
The struct is there, but not the constructor or methods.
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.
So close.
However when I try to use this the Get(string)
and SetIcon(string)
methods are not found on Getter
. We may need public definitions that wrap...
Or you could use type Getter = commands.Getter
to expose all of the internally-public methods.
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.
Looks good to me. Might be good to get another 👍 if possible, but it won't block merging.
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.
Looks like everything I'd commented on has been addressed.
Sorry for the force push. Had to rebase on develop and git wouldn't let me push normally. |
WIll need work in the future to propertly expose bundler, packager, installer and releaser.
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.
Looks like a random code addition snuck into cmd/hello/main.go
Description:
This PR moves ahead with the task of porting over the entire
cmd/fyne
cli application to using https://github.com/urfave/cli. It currently needs more testing and I would like if people take a look at my proposed flag aliases and names along with any usages or descriptions that need to be updated with better wording. Of note is that thecmd/fyne/commands
package has a couple breakages, but it should only affect the commands themselves (I don't think the intention ever was to let other people create cli applications with it).The work on porting to cobra was abandoned due to the fact that flags had to be posix compliant.
Supersedes #1312
Checklist:
Where applicable: