Comments (19)
I also ran into this using etcdctl. Check this out:
--peers, C [] -peers, C option -peers, C option
a comma-delimited list of machine addresses in the cluster (default: {"127.0.0.1:4001"})
But actually doing something like -peers 127.0.0.1,127.0.0.2
doesn't work. What does work is specifying it multiple times like peers 127.0.0.1 -peers 127.0.0.2
.
from cli.
If you use an example like this one
cli.StringSliceFlag{
"dns",
&cli.StringSlice{"8.8.8.8", "8.8.4.4"}, //here we are setting some predefined values
"set one or more dns Servers"
},
help output
OPTIONS:
--dns [8.8.8.8 4.4.4.4] `-dns option -dns option` set one or more dns Servers
does it make sense now?
from cli.
It seems like the confusing part of the help output is the word "option" in -lang option -lang option
from cli.
@thesyncim I appreciate the explanation! However, I'm more confused by what @tjarratt is referring to.
from cli.
@cab sorry, I was trying to explain which part of the help message I found confusing. The part that I find most confusing is the word "option". It would be easier to understand if there was some indication that option
is really just a placeholder for user input.
from cli.
@tjarratt I worded my last response poorly, I meant to say that I'm confused by the same thing :).
from cli.
I agree that it is a little confusing. Would something like -lang <option> -lang <option>
be more clear?
from cli.
I would expect the output to show cleanly the default values, like any other flag:
OPTIONS:
--lang english, --lang spanish language for the greeting
from cli.
@vieux agreed, but how would you also display the short name there (in non-slice types it has --lang, l 'english'
, but something like --lang, -l english, --lang, -l spanish language for the greeting
looks weird). I guess this would be solved by specifying the defaults after the usage (or allowing the user to template in the defaults like in Python's optparse
), but I'm not sure if that would be breaking the API of this library.
from cli.
The help output for slice types has been changed (significantly?) since this issue was last updated, and I don't think it's relevant anymore. Please yell if you disagree!
from cli.
Current help output for slice flags is not intuitive. It does not provide any hint that the flag should be specified multiple times. For example, the following is a slice flag
--domains value, -d value Add domains to the process
...how will the user know that they should include this multiple times if they want to pass in multiple domains!? A naive user might attempt to put all the domains together e.g. --domains example1.com example2.com
This form makes more sense to me:
--domains, -d [--domains option --domains option] Add domains to the process
from cli.
Agreed, reopening
from cli.
I will jump to the discussion and say that I would agree with @jefferai something like
--items=1.2.3.4/32,2.3.4.5/32
or ...
--items="1.2.3.4/32 2.3.4.5/32"
Would make more sense in my use case scenarios.
from cli.
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.
from cli.
\\ bump ^^ I think there's definitely something we could do here
from cli.
This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.
from cli.
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.
from cli.
Closing this as it has become stale.
from cli.
Fixed and merged. b80ff3d
from cli.
Related Issues (20)
- Compatibility for cli.Context and context.Context HOT 2
- IsSet breaks with Persistent option HOT 3
- [v3] `Required` does not work with `Persistent` HOT 2
- [v2] Is there any way to customize the format of flag's help text? HOT 7
- [v3] Missing `Required` flags show alias rather than primary name HOT 2
- [v3] `Validator` seems to always receive the empty string HOT 4
- [v3] Long flag usage text uses short flag syntax HOT 2
- [v3] how to chain multible Sources? HOT 11
- Execute `runFlagActions` before `c.Before` HOT 3
- `cli.UintSliceFlag` flags do not implement the `ActionableFlag` interface despite having an `Action` field
- Generate markdown from help HOT 3
- SliceFlagSeparator can affect subcommands, whereas DisableSliceFlagSeparator does not. HOT 1
- v3 MutuallyExclusive flags are not included in help text HOT 7
- FullName not working as it did in 2.19.3, seems to have broken in 2.20.0 HOT 3
- Categories with no visible flags are still visible HOT 1
- FilePath does not take precedence over EnvVar
- how to distinguish a flag between manually set or default settings ? HOT 1
- How to make builtin Usage value capitalized HOT 2
- Shell completion requires double TAB on first usage HOT 5
- Shell completion is suggesting aliases HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.