Skip to content

Commit

Permalink
Merge pull request #2 from davidem/version
Browse files Browse the repository at this point in the history
Added -v|--version similar to PR hnarayanan#64 from @ericmarkmartin, but with a…
  • Loading branch information
davidem authored Jun 9, 2020
2 parents 1d2ca3b + 01c1646 commit eb95d6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ spotify toggle repeat Toggles repeat playback mode.
spotify list uri <format> <uri> List uri,title,artist and album of specific playlist, format in csv|tsv|text|html"
spotify list mine <format>* List 'my' playlists (uri, title, public), format in csv|tsv|texst|html";
echo " * Please note that this requires authentication via a browser."
* Please note that this requires authentication via a browser."
spotify -v | --verision Shows the shpotify and spotify versions.";
````

## Authors and contributing
Expand Down
12 changes: 12 additions & 0 deletions spotify
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

SHPOTIFY_VERSION="2.1.1_DM_fork"
USER_CONFIG_DEFAULTS="CLIENT_ID=\"\"\nCLIENT_SECRET=\"\"";
USER_CONFIG_FILE="${HOME}/.shpotify.cfg";
if ! [[ -f "${USER_CONFIG_FILE}" ]]; then
Expand Down Expand Up @@ -106,9 +107,16 @@ showHelp () {
echo;
echo " connect <device_id> # Connect and play music on another device. ID can be found with 'list devices'.";
fi
echo;
echo " -v | --version # Shows the shpotify and spotify versions.";
showAPIHelp
}

showVersion() {
cecho "shpotify.sh: $SHPOTIFY_VERSION";
cecho "spotify: `osascript -e 'get version of application "Spotify"'`"
}

cecho(){
bold=$(tput bold);
green=$(tput setaf 2);
Expand Down Expand Up @@ -629,6 +637,10 @@ while [ $# -gt 0 ]; do
"help" )
showHelp;
break ;;

"-v" | "--version" )
showVersion | column -t;
break ;;
* )
showHelp;
exit 1;
Expand Down

0 comments on commit eb95d6e

Please sign in to comment.