From 508f175af3df30d52b409fa1d20251b6fe61d3ae Mon Sep 17 00:00:00 2001 From: Lexus Drumgold Date: Sat, 1 Oct 2022 21:29:15 -0400 Subject: [PATCH] feat(cli): toggle Signed-off-by: Lexus Drumgold --- package.json | 3 +-- src/cli.ts | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e9040833..2f927bd4 100644 --- a/package.json +++ b/package.json @@ -73,8 +73,7 @@ "release": "bash ./scripts/release.sh", "test": "vitest run", "test:cov": "yarn test --coverage", - "test:watch": "vitest", - "toggle-pkg-type": "node --loader=./loader.mjs ./src/cli" + "test:watch": "vitest" }, "devDependencies": { "@commitlint/cli": "17.1.2", diff --git a/src/cli.ts b/src/cli.ts index 916ef577..e4f06ee2 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -7,9 +7,13 @@ import sade from 'sade' import pkg from '../package.json' assert { type: 'json' } +import toggle from './toggle' sade(`${pkg.name.replace(/.*\//, '')} [off|on]`) .version(pkg.version) .describe(pkg.description) - .action((): void => void 0) + .example('') + .example('off') + .example('on') + .action((command?: 'off' | 'on'): void => void toggle(command)) .parse(process.argv)