Skip to content

Instantly share code, notes, and snippets.

@alxf
Created January 24, 2012 14:56
Show Gist options
  • Save alxf/1670552 to your computer and use it in GitHub Desktop.
Save alxf/1670552 to your computer and use it in GitHub Desktop.
Auto generated command shell script
#
# ./command.sh help
# HELP MESSAGE
# ./command.sh first
# FIRST COMMAND
#
command_help()
{
echo "HELP MESSAGE"
}
command_first()
{
echo "FIRST COMMAND"
}
case $1 in
*)
if type "command_$1" > /dev/null 2>&1; then
cmd="$1"
shift
eval "command_$cmd $@"
fi
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment