From cbead3f8860599ac92e2cda036acd89e57ae1a94 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Tue, 23 Oct 2018 05:29:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20We=20can=20call=20script=20direc?= =?UTF-8?q?tly=20due=20to=20shebang,=20no=20need=20to=20prepend=20node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/funcs/parseArguments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/funcs/parseArguments.ts b/src/funcs/parseArguments.ts index 62b066c..25c150d 100644 --- a/src/funcs/parseArguments.ts +++ b/src/funcs/parseArguments.ts @@ -59,7 +59,7 @@ export default function parseArguments(spec: { [key: string]: IOption }): { fail 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}]) => ( ` ${(defaultValue === undefined) ? '' : '['}${(short !== undefined && short !== '') ? `-${short}, ` : ''}--${key} ${(defaultValue === undefined) ? '' : `], defaults to "${defaultValue}"`}${(description !== undefined && description !== '') ? `\n ${description}` : ''}` )).join('\n')