iffy / nim-argparse

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

Cannot have a non-constant string name for a parser #45

Closed rrthomas closed 3 years ago

rrthomas commented 3 years ago

Making a parser for a program, it is natural to use the program's name as the name of the parser, and it is conventional to get this name from argv[0], so something like:

import system
let progName = lastPathPart(getAppFilename())

But progName cannot be passed as an argument to newParser() (unless I've misunderstood!).

iffy commented 3 years ago

I think this is related to https://github.com/iffy/nim-argparse/issues/33

rrthomas commented 3 years ago

Yes, basically the same bug, feel free to merge, and sorry I didn't recognise #33 as being the same before (I did see it!).