iffy / nim-argparse

Argument parsing for Nim
MIT License
121 stars 8 forks source link

IndexError when option is missing argument #29

Closed SoftwareApe closed 3 years ago

SoftwareApe commented 4 years ago

Behavior

You specify a parser with an option argument. E.g.

var argparser = newParser("my prog"):
    option("-f", "--file", multiple=false, help="File to process")
run:
    ...

If you call this program with

argparser.run(commandLineParams())

and then only supply e.g. the option "-f" you get an IndexError.

Expected Behavior

Instead of an index error print a help message that the option is missing a value.

iffy commented 3 years ago

Fixed in v1.0.0