Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dispathAs(foobar, foobarMain) => creates proc foobarMain(args: seq[string]): int #45

Closed
timotheecour opened this issue Nov 8, 2018 · 0 comments

Comments

@timotheecour
Copy link
Contributor

timotheecour commented Nov 8, 2018

/cc @c-blake

I'd like to use cligen in a more flexible way as follows:

proc foobar(foo=1, bar=2.0, baz="hi", verb=false, paths: seq[string]): int =
  ...

dispathAs(foobar, foobarMain)
# creates `proc foobarMain*(args: seq[string]): int` ; this can be called eg via: foobarMain(["-f:3", "--baz:mybaz"])

it adds flexibility to integrate in more complex libraries, eg when args are provided from another source (could be forwarded from post processed command line or from any other source)

Hopefully this is a simple change

timotheecour added a commit to timotheecour/cligen that referenced this issue Nov 8, 2018
@timotheecour timotheecour mentioned this issue Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant