From f87e76d6245c7af77f1db8f4689c0ef3be449669 Mon Sep 17 00:00:00 2001 From: Siddharth Singh Date: Mon, 30 Sep 2024 02:39:05 +0530 Subject: [PATCH] .action --> doAction --- tribes-cli/utils/command.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tribes-cli/utils/command.ts b/tribes-cli/utils/command.ts index 0e8dcc43..28f1b48c 100644 --- a/tribes-cli/utils/command.ts +++ b/tribes-cli/utils/command.ts @@ -5,7 +5,7 @@ import { parseSubcommand } from './parsing.ts'; export class Command { name: string; description: string; - action: (args: ParsedArgs) => void | Promise = (_) => {}; + private action: (args: ParsedArgs) => void | Promise = (_) => {}; options: Record = {}; commands: Record = {}; @@ -38,6 +38,10 @@ export class Command { return this; } + async doAction(args: ParsedArgs) { + return await this.action(args); + } + subcommand(command: Command) { if (this.isValidSubcommand(command.name)) { throw new Error(`tribes-cli: ${command.name} is already a subcommand.`);