getopts icon indicating copy to clipboard operation
getopts copied to clipboard

Better usage examples

Open watzon opened this issue 9 years ago • 4 comments
trafficstars

There are a lot of pieces to this that are uncovered in the example supplied in the docs. More examples would help to better show off how to use this

watzon avatar Jul 03 '16 19:07 watzon

I'd find it helpful if you could say what specifically would have been useful.

tromey avatar Sep 09 '16 02:09 tromey

I agree with @iDev0urer . There should be more examples. For example, the beginning of the documentation mentions reqopt but does not tell what it is or how you use it. Also the documentation tells it is possible to create custom options and pass them to getopts.

Another thing, I don't even know if this is possible with getopts, are subcommands, where one command is only available if you specified another command before.

Loris1123 avatar Sep 17 '16 14:09 Loris1123

One thing that I thought was missing until I looked close at the docs was multi for options and flags (e.g. .optmulti, .optflagmulti. It might be nice to either include these in the main example or in the description mention them in this part of the description:

Construct a vector of options, either by using reqopt, optopt, and optflag or by building them from components yourself, and pass them to getopts

moore3071 avatar Aug 09 '17 18:08 moore3071

More examples are always welcome if anyone would like to submit PRs!

KodrAus avatar Oct 15 '18 02:10 KodrAus