Open tavurth opened 2 years ago
Seems that changing my code to template works, but it would be really nice to have a way to convert the current argument set to a tuple.
template some_run_func(opts: untyped): void =
echo opts.preload
var parser = newParser("server"):
flag("-p", "--preload", help="Should we preload data")
try:
some_run_func(parser.parse())
except UsageError:
echo parser.help
stderr.writeLine getCurrentExceptionMsg()
quit(1)
This is related to #63
Unfortunately, there's not a type defined that you can use at this point. But I realize how valuable it would be. I'll see if anything has changed in the latest versions of Nim.
Looks like the situation is the same. When I get around to #78, I may attempt a refactor that would expose the options type to users.
Hi I was wondering which type I should use to pass the arguments around, something like this: