Cairo Args Runner is a streamlined utility for executing Cairo 1 programs with command-line arguments. It enhances the user experience by enabling direct argument specification in the command line, thus simplifying the execution of Cairo programs.
You can run all examples with:
./run.sh
Here are examples for running different Cairo programs:
Firstly build examples with:
scarb build
And then build the runner with:
cargo build --release
echo "[1, 2, 3]" | cargo run --release -- target/dev/e1_struct_with_values.sierra.json
The output should be [1, 2, 3]
.
echo "[[1, 9, 1], 7, []]" | cargo run --release -- target/dev/e2_arrays.sierra.json
The output should be [11, 7, 0]
.
echo "[[1, 2, 3]]" | cargo run --release -- target/dev/e3_struct_with_array.sierra.json
The output should be [6]
.
echo "[[1, 2, 3], [1, 3, 9]]" | cargo run --release -- target/dev/e4_struct_with_arrays.sierra.json
The output should be [6, 13]
.