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

Enable `args` in script #538

Closed
ctongfei opened this Issue Dec 30, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@ctongfei
Copy link

ctongfei commented Dec 30, 2016

Is it possible to enable access to args variable in code without a function annotated with @main?
It'd be good if args can be accessed.

@jatcwang

This comment has been minimized.

Copy link

jatcwang commented Jan 1, 2017

This feature is part of #423 which I'm currently working on.

@lihaoyi

This comment has been minimized.

Copy link
Owner

lihaoyi commented May 19, 2017

Fixed in c605d86#diff-d624941e18d4c528c725d4c3c0bd0517R1089

This lets @main methods with varargs properly slurp in everything, allowing you to then use your own custom argument parser. The only caveat is you cannot use -- in your own argument list, since that is reserved to separate Ammonite's arguments from your script's arguments.

Please take a look at the changelog entry which describes this and let me know if this satisfies your requirements

@lihaoyi lihaoyi closed this May 19, 2017

@lihaoyi

This comment has been minimized.

Copy link
Owner

lihaoyi commented May 21, 2017

@jatcwang

This comment has been minimized.

Copy link

jatcwang commented May 23, 2017

Excellent will give it a go. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.