UNPKG

cli-grafith-is

Version:

This is a cli for a lib to know if a number is even. (is a joke with the brazilian band: Grafith)

19 lines (17 loc) 632 B
const is = require('grafith-is'); const input = process.argv.slice(2); const operation = input.slice(-1)[0]; const pkg = require('./package.json'); if (operation === '-v' || operation === '--version') { console.log(`grafith-is: ${pkg.version}`); } else if (operation === '-h' || operation === '--help' || operation === 'grafith-is') { console.log(` Usage: grafith-is <number> Description: ${pkg.description} Options:\n -h, --help output usage information -v, --version output the version number`); } else { console.log(`${is(Number(input), () => {return;}, () => {return;})}`); }