-
Notifications
You must be signed in to change notification settings - Fork 274
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
Features for v3 #90
Comments
It would be nice when kingpin used the package godoc (maybe even the function goods) to generate the manpage. |
I'm not sure how that would work. What documentation would it extract? From where? |
+1 for "Rethink the way @ and - work" specifically the single - by itself |
+1 for comma-separated lists with autocompletion: |
(I'm not sure if this issue is an invitation for feature requests, sorry 😇 ). There's one thing I've wanted more than once that might fall under what you mean for for 'Help "sections"', I'm not sure: "long" help for certain items, usually subcommands. Basically, I wish for a one-line help summary that shows in In one (internal tool) case I resorted to using backtick literals for such long help, but that isn't ideal—it makes the default usage Also, +1 on |
That's a good idea @ches. |
Maybe it is already possible, but otherwise an idea would be to show boolean flags with |
Yes, agreed, that would be very useful. |
Also, what You think about allowing the hintAction on .Short('')? That doesn't work at the moment... |
Can you clarify? Do you mean completion won't complete short flags? |
Is it possible to have the HintAction() on one option be dependent on the value of another part of the command. e.g. I have a sub-command with a --installThisVersion flag, but the list of available versions would be dependent on something specified earlier on the same command line, like :
In my actual use case, I'd like the HintAction command to go off to a web service and query it for a list of possible completions, but I need someway to get a parameter into the HintAction function, and the value of that parameter needs to come from another part of the command line. Is this at all possible? |
@godeater This sounds like a question that would be more appropriate for someplace like Stack Overflow than this roadmap issue. I have done something similar to what you're asking with Kingpin, it's a bit ugly and I'm not entirely happy with the solution, but it does get the job done for me. I can share it in a more topical forum. |
@ches as is ever the way, in writing up the stackoverflow question, I made this work. So I guess this isn't a feature request :) |
|
Maybe I am too late to the game to suggest features for V3. Any thoughts about trying to guess the command a user wanted? For example: myprompt: git shwo Did you mean this? ps. Just used kingpin for the first time. Switched from the default "flag" library. Kingpin made my application better, plus resulted in less code that was clearer to understand. |
That would be quite useful, though I think it could be already possible with use of the |
In reference to:
I'm not sure if you're looking to see if it was specifically passed bare once, or if it was passed at all. At times I see problems distinguishing between the default for a flag and that same value passed. I personally have another flag package that adds an I believe similar behavior could currently be achieved with |
Something like |
Errors for {"msg":"required flag --twitter-consumer-secret not provided","ts":"2018/01/14 21:10:52"} ... should be:
|
this issue is abandoned? |
Will you consider release a preview or alpha version for v3 in recent future? |
This issue is to track feature implementation for v3. I'm mostly happy with the core functionality in v2, but there are a few rough edges. To that end, v3 will be mostly cleanup and streamlining.
Action(*Context)
should be something likeAction(value Value)
perhaps, and called something other than Action. Not sure. See feature request: min length, max length, and whitespace trimming #125.@
and-
work. See flag parsing prevents using "-" or @FILE in conventional ways #65.regexp
package works.APP="-a -bfoo --something"
foo=${BAR}
and flagbar=asdf
,foo
will evaluate toasdf
.Usage(text)
andWriteUsage*
.--purge
,--purge=24h
? Could use a nil value to indicate not provided? Not sure this is a good idea, plus it's hard to parse.--help
flag (see How to override HelpFlags? #119)--version
and--help
should go to stdout, errors to stderr (eg. --version is output to stderr instead of stdout #120) (implemented in 9f68dc0)net.*
types.Default()
apply before parsing (implemented in 3f9c38e)XXXOption
configuration closure convention? eg.Strings(options...ValueOption)
wheretype ValueOption func(conf map[string]string) error
? (b88248d)cmd0 <arg0> <arg1> cmd1 <arg2>
) (801d8e5).The text was updated successfully, but these errors were encountered: