Skip to content

Commit

Permalink
cleanup #1
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Sep 29, 2015
1 parent 177b4bf commit dda0329
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ var parseHeaders = require('parse-headers');
var pkg = require('./package.json');

var options = subarg(process.argv.slice(2), {
'boolean': [
boolean: [
'verbose',
'crop',
'help',
'version'
],
'default': {
default: {
delay: 0,
scale: 1
},
'alias': {
alias: {
v: 'verbose',
c: 'crop',
d: 'delay'
Expand Down Expand Up @@ -161,12 +161,11 @@ function parse(args, globalOptions) {
options.hide = arrify(options.hide);
}

// var basicUrlRegex = /\.|localhost/;
var urlRegex = /(http(s)?:\/\/)([^.]+)|localhost|\./;
var urlRegex = /https?:\/\/|localhost|\./;
var sizeRegex = /^\d{3,4}x\d{3,4}$/i;

var url = arrayUniq(arg.filter(function (a) {
return urlRegex.test(a); // || basicUrlRegex.test(a);
return urlRegex.test(a);
}));

var sizes = arrayUniq(arg.filter(function (a) {
Expand Down Expand Up @@ -215,6 +214,7 @@ function init(args, options) {

var parsedArgs = parse(args, options);
var items = get(parsedArgs);

generate(items, options);
}

Expand Down

0 comments on commit dda0329

Please sign in to comment.