Skip to content

Commit

Permalink
Rename option start to play
Browse files Browse the repository at this point in the history
  • Loading branch information
mischah committed Oct 30, 2015
1 parent 4346a0f commit 12e90a9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 deletions.
23 changes: 16 additions & 7 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,27 @@ var cli = meow([
' $ itunes-remote [<artist|album|song> ...]',
'',
'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',
Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -104,5 +104,4 @@ module.exports = function (str, opts) {
}

return 'Hold on …';
// return str + ' & ' + (opts.postfix || 'rainbows');
};
35 changes: 20 additions & 15 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,40 @@
## Install

```
$ npm install --save itunes-remote
$ npm install --global itunes-remote
```


## Usage

```
$ npm install --global itunes-remote
```

```
$ itunes-remote --help
Usage
$ itunes-remote [<artist|album|song> ...]
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'
```


Expand Down

0 comments on commit 12e90a9

Please sign in to comment.