diff --git a/cli.js b/cli.js index 369264d..1b0faad 100755 --- a/cli.js +++ b/cli.js @@ -8,18 +8,27 @@ var cli = meow([ ' $ itunes-remote [ ...]', '', 'Options', - ' --stop Stop playing the current selection. [Default: false]', - ' --start Start playing the current selection. [Default: true]', + ' --play Start playing the current selection or search result. [Default: true]', + ' --stop Stop playing the current selection or prevent playing the current search result. [Default: false]', + ' --pause Pause playing the current selection. [Default: false]', '', 'Examples', - ' $ itunes-remote she', + ' $ itunes-remote nicknack', ' Hold on …', - ' ✔ Found songs, albums and artists containing ”she“ and generated a playlist', - ' ✔ Playing 12 song(s) ♪♬', + ' ✔ Found songs, albums and artists containing ”nicknack“ and generated a temporary playlist', + ' ✔ Playing 44 song(s) ♪♬', '', - ' $ itunes-remote she --stop', + ' $ itunes-remote --pause', ' Hold on …', - ' ✔ Found songs, albums and artists containing ”she“ and generated a playlist' + ' ✔ Paused playing ♪♬', + '', + ' $ itunes-remote --play', + ' Hold on …', + ' ✔ Playing ♪♬', + '', + ' $ itunes-remote emancipator --stop', + ' Hold on …', + ' ✔ Found songs, albums and artists containing ”emancipator“ and generated a temporary playlist' ], { alias: { v: 'version', diff --git a/index.js b/index.js index f323da7..70bb237 100644 --- a/index.js +++ b/index.js @@ -63,7 +63,7 @@ function startSearch(searchTerm, opts) { if (err === null && amount) { console.log(logSymbols.success, 'Found songs, albums and artists containing ”' + chalk.inverse(searchTerm) + '“ and generated a temporary playlist'); - if (opts.start) { + if (opts.play) { startPlaylist(playlist, amount); } } else if (err === null) { @@ -82,12 +82,12 @@ module.exports = function (str, opts) { if (str) { if (isEmptyObject(opts)) { - opts = {start: true}; + opts = {play: true}; } startSearch(str, opts); } else { // console.log(opts); - if (opts.start === true) { + if (opts.play === true) { startPlayBack(); } if (opts.stop === true) { @@ -104,5 +104,4 @@ module.exports = function (str, opts) { } return 'Hold on …'; - // return str + ' & ' + (opts.postfix || 'rainbows'); }; diff --git a/readme.md b/readme.md index 427eb74..07efd69 100644 --- a/readme.md +++ b/readme.md @@ -8,16 +8,12 @@ ## Install ``` -$ npm install --save itunes-remote +$ npm install --global itunes-remote ``` ## Usage -``` -$ npm install --global itunes-remote -``` - ``` $ itunes-remote --help @@ -25,18 +21,27 @@ $ itunes-remote --help $ itunes-remote [ ...] Options - --stop Stop playing the current selection. [Default: false] - --start Start playing the current selection. [Default: true] + --play Start playing the current selection or search result. [Default: true]', + --stop Stop playing the current selection or prevent playing the current search result. [Default: false]', + --pause Pause playing the current selection. [Default: false]', Examples - $ itunes-remote she - Hold on … - ✔ Found songs, albums and artists containing ”she“ and generated a playlist - ✔ Playing your songs (っ◕‿◕)っ - - $ itunes-remote she --stop - Hold on … - ✔ Found songs, albums and artists containing ”she“ and generated a playlist + $ itunes-remote nicknack', + Hold on …', + ✔ Found songs, albums and artists containing ”nicknack“ and generated a temporary playlist', + ✔ Playing 44 song(s) ♪♬', + + $ itunes-remote --pause', + Hold on …', + ✔ Paused playing ♪♬', + + $ itunes-remote --play', + Hold on …', + ✔ Playing ♪♬', + + $ itunes-remote emancipator --stop', + Hold on …', + ✔ Found songs, albums and artists containing ”emancipator“ and generated a temporary playlist' ```