Add help to scripts

This commit is contained in:
Alisina Bahadori
2020-09-07 23:16:37 +04:30
parent eb4bf1c815
commit 468fae6586
2 changed files with 12 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
#!/bin/sh -e
if [ "$1" = "" ]; then
if [ "$1" = "-h" ]; then
echo "usage: digitallify.sh <outputfile> <images_directory>"
exit 0
elif [ "$1" = "" ]; then
echo "Please provide a filename as the first argument"
exit 1
elif [ "$2" = "" ]; then

View File

@@ -6,6 +6,14 @@ do
if [ ${!i} = "-c" ]
then ((i++))
comment=${!i};
elif [ ${!i} = "-h" ]
then ((i++))
echo "usage: paperify.sh [OPTIONS] <FILE>"
echo ""
echo "options:"
echo -e " -h\t\tShow this help."
echo -e " -c COMMENT\tAdd comment to the generated files."
exit 0
else
file="$INPUT_DIR${!i}";
fi