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.`);