iffy / nim-argparse

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

There are sometimes conflicts with procs named `run` #49

Open iffy opened 3 years ago

iffy commented 3 years ago
import argparse
proc run(args: varargs[string]) = discard
let p = newParser("foo"):
  run:
    echo $opts
p.run()

Fails to compile:

/private/tmp/samp.nim(6, 18) template/generic instantiation of `newParser` from here
/private/tmp/samp.nim(8, 11) Error: undeclared identifier: 'opts'