Bash Args is a simple way for get arguments in your bash script.
Download this repo tarball or on releases page and include lib like on example below.
#!/bin/bash
source $(pwd)/lib/args.sh
For use this script, you define what argument name and variable that will receive value, like example below.
my_key=$(bash_args_get_value "my-amazing-secret-key" "$@")
echo $my_key
After this, if you inform param in your script, the value will be assigned on variable.
Bash args support this argument formats.
./myscript -my-amazing-secret-key value
./myscript -my-amazing-secret-key=value
./myscript --my-amazing-secret-key value
./myscript --my-amazing-secret-key=value
For testing, bats is required.
cd tests
bats main.bats