From c08fca953844f713f95bbb376fbbb79f200c28d2 Mon Sep 17 00:00:00 2001 From: ericmarkmartin Date: Thu, 22 Sep 2016 22:55:15 -0400 Subject: [PATCH 1/2] Added version command --- spotify | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spotify b/spotify index 6684c7a..1fdb1e3 100755 --- a/spotify +++ b/spotify @@ -62,6 +62,10 @@ showHelp () { echo " toggle repeat # Toggles repeat playback mode."; } +showVersion() { + echo "shpotify 1.2.0"; +} + cecho(){ bold=$(tput bold); green=$(tput setaf 2); @@ -346,8 +350,13 @@ while [ $# -gt 0 ]; do osascript -e "tell application \"Spotify\" to set player position to $2"; break;; + "-v" | "--version" ) + showVersion; + break ;; + "help" | * ) showHelp; break ;; + esac done From fe1c28428769d65f1108633bec43efc8c79f6bdf Mon Sep 17 00:00:00 2001 From: ericmarkmartin Date: Thu, 22 Sep 2016 23:03:58 -0400 Subject: [PATCH 2/2] Added version command to documentation --- README.md | 2 ++ spotify | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index cb2f22b..0820cf1 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ spotify share uri Displays the current song's Spotify URI and c spotify toggle shuffle Toggles shuffle playback mode. spotify toggle repeat Toggles repeat playback mode. + +spotify -v | --version Shows the shpotify version number. ```` ## Authors and contributing diff --git a/spotify b/spotify index 1fdb1e3..ed4db29 100755 --- a/spotify +++ b/spotify @@ -60,6 +60,8 @@ showHelp () { echo; echo " toggle shuffle # Toggles shuffle playback mode."; echo " toggle repeat # Toggles repeat playback mode."; + echo; + echo " -v | --version # Shows the shpotify version number."; } showVersion() {