diff --git a/index.ts b/index.ts index a4573ce..316d642 100644 --- a/index.ts +++ b/index.ts @@ -3,10 +3,10 @@ import { Command } from 'commander' import { spinnerError, stopSpinner } from './spinner'; import { widgets } from './widgets'; -const program = new Command('Our New CLI'); +const program = new Command(); +program.description('Our New CLI'); program.option('-v, --verbose', 'verbose logging'); program.version('0.0.1'); -program.addHelpCommand() program.addCommand(widgets); async function main() { diff --git a/package-lock.json b/package-lock.json index 954b2c4..523d621 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,9 @@ }, "bin": { "terribledev": "dist/index.js" + }, + "devDependencies": { + "typescript": "^4.7.4" } }, "node_modules/@types/node": { @@ -659,6 +662,19 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/typescript": { + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -994,6 +1010,12 @@ "ansi-regex": "^6.0.1" } }, + "typescript": { + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index 65368f5..3cbddf6 100644 --- a/package.json +++ b/package.json @@ -18,5 +18,8 @@ }, "bin": { "terribledev": "./dist/index.js" + }, + "devDependencies": { + "typescript": "^4.7.4" } } diff --git a/widgets.ts b/widgets.ts index 1f3f2ea..6970404 100644 --- a/widgets.ts +++ b/widgets.ts @@ -12,7 +12,7 @@ widgets.command("list").action(async () => { }) widgets.command("get") -.argument("widget id ", "the id of the widget") +.argument("", "the id of the widget") .option("-f, --format ", "the format of the widget") .action(async (id, options) => { updateSpinnerText("Getting widget " + id);