add star case to getopts

This commit is contained in:
Greg Gauthier 2022-12-25 10:22:02 +00:00
parent 657766ca06
commit 6f4562fff0

10
new
View File

@ -10,9 +10,9 @@ Help()
echo echo
echo "Syntax: new -c contentType -t 'some title'" echo "Syntax: new -c contentType -t 'some title'"
echo "options:" echo "options:"
echo "c Content Type: 'post', 'podcast', 'reading'" echo "-c [required] Content Type: 'post', 'podcast', 'reading'"
echo "t Content Title: \"Any Plain Text At All\"" echo "-t [required] Content Title: \"Any Plain Text At All\""
echo "h This display." echo "-h This display."
exit 0 exit 0
} }
@ -21,7 +21,9 @@ do
case "${flag}" in case "${flag}" in
c) contentType=${OPTARG};; c) contentType=${OPTARG};;
t) title=${OPTARG};; t) title=${OPTARG};;
h) Help h) Help;;
*) echo "-h for help" >&2
exit 1 ;;
esac esac
done done