From 7486a165d53e84ac656f3e6c4674db75854d16f5 Mon Sep 17 00:00:00 2001 From: Anthony Date: Tue, 21 Nov 2017 20:34:27 +0100 Subject: [PATCH] Add files via upload --- bin/helpers.js | 60 ++++++++++++++++++++++++----------- package.json | 85 ++++++++++++++++++++++++++------------------------ 2 files changed, 86 insertions(+), 59 deletions(-) diff --git a/bin/helpers.js b/bin/helpers.js index 7f6a5e9..7e599cc 100644 --- a/bin/helpers.js +++ b/bin/helpers.js @@ -1,18 +1,6 @@ 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); @@ -20,21 +8,55 @@ const version = () => { const help = () => { console.log(chalk.yellow(` - Usage: +Usage: + + $ cash + + $ cash - $ cash +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; diff --git a/package.json b/package.json index 6890d19..0c10e9b 100644 --- a/package.json +++ b/package.json @@ -1,41 +1,46 @@ { - "name": "cash-cli", - "version": "1.2.8", - "description": "Exchange Rates Online using your terminal!", - "author": { - "name": "Anthony Kepinski", - "email": "hello@akepinski.me", - "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": "hello@akepinski.me", + "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" + } +} \ No newline at end of file