Created
September 16, 2019 18:09
-
-
Save korzio/ddf77b7f266ed155a10ba69bdade5a44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const { description, name, version } = require('./package.json') | |
const options = process.argv.slice(2) | |
const VERSION_MESSAGE = `${name} ${version}` | |
const HELP_MESSAGE = `${VERSION_MESSAGE} | |
${description} | |
Usage: | |
--help Help documentation | |
--version Installed package version` | |
if (options.includes('--version')) { | |
console.log(VERSION_MESSAGE) | |
} else { | |
console.log(HELP_MESSAGE) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment