From 2d7330446d65b652ebad459adcc26ec241488752 Mon Sep 17 00:00:00 2001 From: Robert Field Date: Fri, 22 Sep 2023 14:03:35 +0100 Subject: [PATCH] feat: added examples for commands --- .../composable-cli/src/commands/config/config-command.tsx | 2 ++ packages/composable-cli/src/commands/login/login-command.ts | 6 +++--- packages/composable-cli/src/composable.ts | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/composable-cli/src/commands/config/config-command.tsx b/packages/composable-cli/src/commands/config/config-command.tsx index 39b25d73..6b50c62b 100644 --- a/packages/composable-cli/src/commands/config/config-command.tsx +++ b/packages/composable-cli/src/commands/config/config-command.tsx @@ -35,6 +35,8 @@ export function createConfigCommand( configClearCommand(ctx.store) }, }) + .example("$0 config list", "list all stored configuration") + .example("$0 config clear", "clear all stored configuration") .help() .demandCommand(1) .strict() diff --git a/packages/composable-cli/src/commands/login/login-command.ts b/packages/composable-cli/src/commands/login/login-command.ts index fea67665..72654a58 100644 --- a/packages/composable-cli/src/commands/login/login-command.ts +++ b/packages/composable-cli/src/commands/login/login-command.ts @@ -66,12 +66,12 @@ export function createLoginCommand( type: "string", description: "Password of Elastic Path account", }) - .example("composable login", "using interactive prompts") + .example("$0 login", "using interactive prompts") .example( - "composable login --region=us-east --username=john.doe@example.com --password=topSecret", + "$0 login --region=us-east --username=john.doe@example.com --password=topSecret", "using command line arguments" ) - .help("h") + .help() .parserConfiguration({ "strip-aliased": true, }) diff --git a/packages/composable-cli/src/composable.ts b/packages/composable-cli/src/composable.ts index 92fdd79f..84ea83f7 100644 --- a/packages/composable-cli/src/composable.ts +++ b/packages/composable-cli/src/composable.ts @@ -57,6 +57,8 @@ export async function main({ .command(createStoreCommand(commandContext)) .command(createGenerateCommand(commandContext)) .command(createInsightsCommand(commandContext)) + .example("$0 login", "using interactive prompts") + .example("$0 logout", "logout of the CLI") .strictCommands() .demandCommand(1) .help("h").argv