dtolabs / rerun-old

This project has moved to https://github.com/rerun/rerun
https://github.com/rerun/rerun/wiki
Apache License 2.0
42 stars 4 forks source link

Expand options to support short and long names #4

Closed ahonor closed 13 years ago

ahonor commented 13 years ago

Extend option metadata to support more kinds of option processing, specifically supporting short and long option names.

Proposed metadata:

noahcampbell commented 13 years ago

What if you defer to the rules defined by getopt (http://www.gnu.org/s/hello/manual/libc/Getopt.html) or getopts (doesn't support long args)?

On Sun, Sep 25, 2011 at 10:55 PM, Alex Honor reply@reply.github.com wrote:

Extend option metadata to support more kinds of option processing, specifically supporting short and long option names.

Proposed metadata:

  • name of option
  • description of option
  • arg label for short option - optional
  • long option - optional
  • arg label for long option - optional
  • type of argument (string or boolean) - optional (default=string)
  • range for the argument - optional
  • name of variable to expose option - optional

Reply to this email directly or view it on GitHub: https://github.com/dtolabs/rerun/issues/4

ahonor commented 13 years ago

I briefly tried both getopt(s) and in the end felt it was too constrained.

ahonor commented 13 years ago

Note mlei's ticket #1 (Explicit false boolean antonyms).

spiette commented 13 years ago

Would you mind elaborate on getopt(s) being too constrained? Some reasons come to my mind: 1) portability, as gnu getopt is not available on osx or freebsd 2) limited functionnality of getopts

spiette commented 13 years ago

I think a first step would be to have the current long options take a double dash in front of them (instead of one). It would be more like most commands. But it would break most existing script using rerun commands. Better to do that sooner than later i guess.

ahonor commented 13 years ago

I agree. We should make long options take a double dash and since it's at the early stage let's not worry about breaking 0.1 versions.