feat(core): add script

This commit is contained in:
Simon Vieille 2023-01-02 11:00:26 +01:00
commit ae909b8305

29
script Executable file
View file

@ -0,0 +1,29 @@
#!/bin/sh
usage() {
printf "Usage: %s [options]\n" "$0"
}
on_interrupt() {
print "Process aborted!\n"
exit 130
}
main() {
while getopts "hf:" option; do
case "${option}" in
h) usage; exit 0;;
f) FOO="$OPTARG";;
*) usage; exit 1;;
esac
done
FOO="${FOO:-defaultValue}"
exit 0
}
trap on_interrupt INT
main "$@"