Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
xxczaki authored Nov 21, 2017
1 parent 9272c92 commit 7486a16
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 59 deletions.
60 changes: 41 additions & 19 deletions bin/helpers.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,62 @@
const chalk = require('chalk');
const pkg = require('../package.json');

const helpers = argv => {
// Version
if (argv.indexOf('--version') !== -1 || argv.indexOf('-v') !== -1) {
version();
}

// Help
if (argv.indexOf('--help') !== -1 || argv.indexOf('-h') !== -1 || !argv.length) {
help();
}
};

const version = () => {
console.log(pkg.version);
process.exit(1);
};

const help = () => {
console.log(chalk.yellow(`
Usage:
Usage:
$ cash <amount> <currency>
$ cash <command>
$ cash <amount> <currency>
Commands:
--help Display help message
--version Display version number
Some currencies: usd, pln, rub, aud, chf, eur
Currencies:
• usd
• pln
• rub
• aud
• chf
• eur
• bgn
• jpy
• cad
• try
• mxn
Examples:
Full list of currencies: http://akep.us/currencies
$ cash 1 usd
Examples:
or
$ cash 1 usd
$ cash 1 usd eur pln aud
$ cash 1 usd eur pln aud
$ cash --help
Cash CLI comes with no warranty.
The rates are updated daily around 4PM CET every working day.
`));
process.exit(1);
};

const helpers = argv => {
// Version
if (argv.indexOf('--version') !== -1 || argv.indexOf('-v') !== -1) {
version();
}

// Help
if (argv.indexOf('--help') !== -1 || argv.indexOf('-h') !== -1 || !argv.length) {
help();
}
};

module.exports = helpers;
85 changes: 45 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
{
"name": "cash-cli",
"version": "1.2.8",
"description": "Exchange Rates Online using your terminal!",
"author": {
"name": "Anthony Kepinski",
"email": "[email protected]",
"url": "https://akepinski.me"
},
"license": "MIT",
"repository": "https://github.com/xxczaki/cash-cli",
"bugs": {
"url": "https://github.com/xxczaki/cash-cli/issues"
},
"homepage": "https://github.com/xxczaki/cash-cli",
"main": "index.js",
"scripts": {
"test": "xo && ava"
},
"bin": {
"cash": "./bin/index.js"
},
"keywords": [
"cli",
"currency",
"exchange",
"rates",
"convert",
"cash"
],
"dependencies": {
"chalk": "^2.3.0",
"got": "^6.5.0",
"money": "^0.2.0",
"ora": "^1.3.0"
},
"devDependencies": {
"xo": "^0.18.2",
"ava": "^0.20.0"
}
}
"name": "cash-cli",
"version": "1.3.6",
"description": "Exchange Rates Online using your terminal!",
"author": {
"name": "Anthony Kepinski",
"email": "[email protected]",
"url": "https://akepinski.me"
},
"license": "MIT",
"repository": "https://github.com/xxczaki/cash-cli",
"bugs": {
"url": "https://github.com/xxczaki/cash-cli/issues"
},
"homepage": "https://github.com/xxczaki/cash-cli",
"main": "index.js",
"scripts": {
"test": "xo && ava"
},
"xo": {
"rules": {
"unicorn/no-process-exit": 0
}
},
"bin": {
"cash": "./bin/index.js"
},
"keywords": [
"cli",
"currency",
"exchange",
"rates",
"convert",
"cash"
],
"dependencies": {
"chalk": "^2.3.0",
"got": "^6.5.0",
"money": "^0.2.0",
"ora": "^1.3.0"
},
"devDependencies": {
"ava": "^0.20.0",
"xo": "^0.18.2"
}
}

0 comments on commit 7486a16

Please sign in to comment.