Skip to content

Add script arguments, implement -c similarly to bash

Jeremy Soller requested to merge script_args into master

This implements script arguments $0, $1, etc.

It also implements bash-compatible syntax for -c, where the first argument is a command string and the later arguments are arguments $0 and on.

Example of -c: ion -c "echo $0 $1 $2 $3" a b c d Output:

a b c d

Example of script:

#test.ion
echo $0 $1 $2 $3

ion test.ion a b c d Output:

test.ion a b c d

Merge request reports