🎨 We can call script directly due to shebang, no need to prepend node

This commit is contained in:
C-3PO 2018-10-23 05:29:00 +02:00
parent 0f72116e30
commit cbead3f886
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -59,7 +59,7 @@ export default function parseArguments(spec: { [key: string]: IOption }): { fail
let argumentOption = ''; let argumentOption = '';
const usage = `node ${process.argv[1].substr(process.argv[1].lastIndexOf('/') + 1)} [options]\nOPTIONS\n${ const usage = `./${process.argv[1].substr(process.argv[1].lastIndexOf('/') + 1)} [options]\nOPTIONS\n${
Object.entries(spec).map(([key, {default: defaultValue, short, description}]) => ( Object.entries(spec).map(([key, {default: defaultValue, short, description}]) => (
` ${(defaultValue === undefined) ? '' : '['}${(short !== undefined && short !== '') ? `-${short}, ` : ''}--${key} <value>${(defaultValue === undefined) ? '' : `], defaults to "${defaultValue}"`}${(description !== undefined && description !== '') ? `\n ${description}` : ''}` ` ${(defaultValue === undefined) ? '' : '['}${(short !== undefined && short !== '') ? `-${short}, ` : ''}--${key} <value>${(defaultValue === undefined) ? '' : `], defaults to "${defaultValue}"`}${(description !== undefined && description !== '') ? `\n ${description}` : ''}`
)).join('\n') )).join('\n')