From 5fe057060982e8dc259f40b7ba3db4f38bba594e Mon Sep 17 00:00:00 2001 From: Louis Le Date: Fri, 5 Jul 2024 10:59:08 +0700 Subject: [PATCH] chore: #754 - add help information into root commands --- .../src/infrastructure/commanders/configs.command.ts | 8 +++----- .../src/infrastructure/commanders/engines.command.ts | 4 +++- cortex-js/src/infrastructure/commanders/models.command.ts | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cortex-js/src/infrastructure/commanders/configs.command.ts b/cortex-js/src/infrastructure/commanders/configs.command.ts index 01f797b1a..c7e841ac2 100644 --- a/cortex-js/src/infrastructure/commanders/configs.command.ts +++ b/cortex-js/src/infrastructure/commanders/configs.command.ts @@ -8,11 +8,7 @@ import { ConfigsSetCommand } from './configs/configs-set.command'; @SubCommand({ name: 'configs', description: 'Get cortex configurations', - arguments: '', subCommands: [ConfigsGetCommand, ConfigsListCommand, ConfigsSetCommand], - argsDescription: { - name: 'Configuration name to get', - }, }) @SetCommandContext() export class ConfigsCommand extends CommandRunner { @@ -20,5 +16,7 @@ export class ConfigsCommand extends CommandRunner { super(); } - async run(): Promise {} + async run(): Promise { + this.command?.help(); + } } diff --git a/cortex-js/src/infrastructure/commanders/engines.command.ts b/cortex-js/src/infrastructure/commanders/engines.command.ts index f88f2a421..0209d309a 100644 --- a/cortex-js/src/infrastructure/commanders/engines.command.ts +++ b/cortex-js/src/infrastructure/commanders/engines.command.ts @@ -16,5 +16,7 @@ export class EnginesCommand extends CommandRunner { super(); } - async run(): Promise {} + async run(): Promise { + this.command?.help(); + } } diff --git a/cortex-js/src/infrastructure/commanders/models.command.ts b/cortex-js/src/infrastructure/commanders/models.command.ts index 17af50c0f..d59f387a1 100644 --- a/cortex-js/src/infrastructure/commanders/models.command.ts +++ b/cortex-js/src/infrastructure/commanders/models.command.ts @@ -23,5 +23,7 @@ import { RunCommand } from './shortcuts/run.command'; description: 'Subcommands for managing models', }) export class ModelsCommand extends CommandRunner { - async run(): Promise {} + async run(): Promise { + this.command?.help(); + } }