diff --git a/SC2145.md b/SC2145.md index f3b4232..5548681 100644 --- a/SC2145.md +++ b/SC2145.md @@ -24,4 +24,31 @@ If the intention is to provide each array element as a separate argument, put th ### Exceptions -None. +```sh +command_foo() { + echo "In foo" + echo "\$1 == $1 == aaa" + echo "\$2 == $2 == bbb" +} + +command_bar() { + echo "In bar" +} + +command_baz() { + echo "In baz" +} + +main() { + case "$1" in + foo | bar | baz ) + command_"$@" + ;; + * ) + printf "Error: %s\n" "Unrecognized command" + ;; + esac +} + +main foo aaa bbb +```