From 32b19dfbcbad80d0d5436533e4ffab23fc9dd1be Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Sat, 25 Feb 2017 19:59:01 -0800 Subject: [PATCH] Clean up usage and add --help --- plexupdate.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plexupdate.sh b/plexupdate.sh index 7842c39..78a06de 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -98,14 +98,15 @@ usage() { echo " -v Show additional debug information" echo "" echo " Long Argument Options:" + echo " --check-update Check for new version of plex only" echo " --config Configuration file to use" echo " --dldir Download directory to use" echo " --email Plex.TV email address" - echo " --pass Plex.TV password" - echo " --server Address of Plex Server" - echo " --port Port for Plex Server. Used with --server" + echo " --help This help" echo " --notify-success Set exit code 10 if update is available/installed" - echo " --check-update Check for new version of plex only" + echo " --pass Plex.TV password" + echo " --port Port for Plex Server. Used with --server" + echo " --server Address of Plex Server" echo "" exit 0 } @@ -125,7 +126,7 @@ trap cleanup EXIT # Parse commandline ALLARGS=( "$@" ) -optstring="-o acCdfFhlpPqrSsuUv -l config:,dldir:,email:,pass:,server:,port:,notify-success,check-update" +optstring="-o acCdfFhlpPqrSsuUv -l config:,dldir:,email:,pass:,server:,port:,notify-success,check-update,help" GETOPTRES=$(getopt $optstring -- "$@") if [ $? -eq 1 ]; then exit 1 @@ -183,6 +184,7 @@ do (--pass) shift; PASS=$(trimQuotes ${1});; (--server) shift; PLEXSERVER=$(trimQuotes ${1});; (--port) shift; PLEXPORT=$(trimQuotes ${1});; + (--help) usage;; (--notify-success) NOTIFY=yes;; (--check-update) CHECKONLY=yes;;