Skip to content

Commit

Permalink
fix(options): ensures an alternative mode is set if no feed is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
naholyr committed Oct 17, 2017
1 parent d305f17 commit c017311
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const checkOptions = options => {
const opts = Object.assign({}, options)
opts.log = opts.log || console.log.bind(console)
opts.langs = opts.langs || opts.lang.split(/\s*,\s*/).map(l => l.trim())
if (!opts.feed && !opts.offline && !opts.browse && opts.movie && !opts.title) {
return Promise.reject(Error('No feed configured, you must configure one or provide one of those options: --offline, --browse, --movie, or <title>'))
}
if (opts.browse || opts.title) {
if (opts.offline) {
return Promise.reject(Error('Using option --browse or <title> is incompatible with offline mode'))
Expand Down

0 comments on commit c017311

Please sign in to comment.