xenomachina / kotlin-argparser

Easy to use and concise yet powerful and robust command line argument parsing for Kotlin
GNU Lesser General Public License v2.1
485 stars 33 forks source link

Is it possible to allow number parameters #58

Closed oshai closed 6 years ago

oshai commented 6 years ago

similar to tail -100 is it possible to have a number param like -<number>?

xenomachina commented 6 years ago

This is not currently possible, but it's an interesting idea. Any thoughts on what the API should look like?

Here's something interesting: tail --help (from GNU coreutils 8.25) makes no mention of the fact that you can say -NUMBER instead of -nNUMBER.

oshai commented 6 years ago

I thought about numeric similar to flagging. In Wikipedia this is mentioned as obselete: https://en.m.wikipedia.org/wiki/Tail_(Unix)

xenomachina commented 6 years ago

The fact that this is an obsolete syntax makes me inclined to say we shouldn't support it.

If it was supported, you'd only ever be able to create one per command line. I suspect that it would also be difficult to get it to play nice with hierarchical arguments (#56) which, I'd really like to implement at some point.