-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use getopt style short/long argument flags (without using getopt package) #34
Conversation
@patrislav1 less code but works a little bit differently for short flags |
don't have a strong opinion, I mean being able to combine flags is nice but it's not crucial and most of the flags require arguments anyway |
--help, -h Show help | ||
--listcolorschemes List color schemes | ||
--transparent Transparent background | ||
--width, -w Terminal width (auto if not set) |
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 shorted some texts to stay within 80 characters. Otherwise help text look good? should include something more?
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.
LGTM
program | %[1]s > file.svg | ||
|
||
`[1:], fs.Name()) | ||
fs.VisitAll(func(f *flag.Flag) { |
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.
Should maybe comment that is a ugly hack to skip the short flags
Mm same :) i usually try to be conservative about not using standard library. But i should probably add some short flag tests at least... and at the same time maybe change the test to use BTW if you want i can add you as a collaborator so you can do more things yourself, i trust your judgement :) |
Thank you 😄 Yes it would make sense then I guess. |
062db47
to
fd0e8f5
Compare
Alternative to #30 without using getopt package. One difference is that multiple short flags can't be combined ex:
-ab
instead of-a -b
does not work.