I have a script that has these contents:
#!/usr/bin/env amm
@main
def ini(args: String*) = {
...
}
My script can't receive arguments that start with a dash, because they are taken as Ammonite arguments, instead of arguments for my script.
If I try to use e.g.
then this is the ouput:
Error: Unknown option -?
ammonite 0.7.6
Usage: ammonite [options] [<file-args>...] [<args>...]
-p <value> | --predef <value>
Any commands you want to execute at the start of the REPL session
--no-default-predef
Disable the default predef and run Ammonite with the minimal predef possible
<file-args>...
The Ammonite script file you want to execute
-c <value> | --code <value>
Pass in code to be run immediately in the REPL
-x | --execute
Shim for backwards compatibility - will be removed
<args>...
Any arguments you want to pass to the Ammonite script file
-h <file> | --home <file>
The home directory of the REPL; where it looks for config and caches
-f <value> | --predef-file <value>
Lets you load your predef from a custom location
-y | --continually
Lets you run a file over and over, useful for benchmarking purposes
since it lets you hook up a profiler to the long-lived process and
see where all the time is being spent.
-s | --silent
Make ivy logs go silent instead of printing though failures will still throw exception
--repl-api
Lets you run a script with the `repl` object present; this is
normally not available in scripts and only provided in the
interactive REpl
I have a script that has these contents:
My script can't receive arguments that start with a dash, because they are taken as Ammonite arguments, instead of arguments for my script.
If I try to use e.g.
then this is the ouput: