Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use meow in CLI
  • Loading branch information
kevva committed May 6, 2015
1 parent 58c6ee5 commit 5a58d49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
33 changes: 10 additions & 23 deletions cli.js
@@ -1,33 +1,20 @@
#!/usr/bin/env node
'use strict';
var pkg = require('./package.json');
var meow = require('meow');
var defaultBrowserId = require('./');
var argv = process.argv.slice(2);

function help() {
console.log([
'',
' ' + pkg.description,
'',
' Example',
' default-browser-id',
' com.apple.Safari'
].join('\n'));
}

if (argv.indexOf('--help') !== -1) {
help();
return;
}

if (argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
meow({
help: [
'Example',
' $ default-browser-id',
' com.apple.Safari'
].join('\n')
});

defaultBrowserId(function (err, id) {
if (err) {
throw err;
console.error(err.message);
process.exit(1);
}

console.log(id);
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -39,6 +39,7 @@
],
"dependencies": {
"bplist-parser": "0.0.6",
"meow": "^3.1.0",
"untildify": "^2.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 5a58d49

Please sign in to comment.