diff --git a/docs/docs/features/argument-parsing/examples/boolean-flag.txt b/docs/docs/features/argument-parsing/examples/boolean-flag.txt index dce4623..8947bd2 100644 --- a/docs/docs/features/argument-parsing/examples/boolean-flag.txt +++ b/docs/docs/features/argument-parsing/examples/boolean-flag.txt @@ -19,9 +19,9 @@ export const root = buildCommand({ docs: { brief: "Example for live playground with boolean flag", customUsage: [ - "--quiet", - "--quiet=yes", - "--noQuiet", + { input: "--quiet", brief: "Flag with no value" }, + { input: "--quiet=yes", brief: "Flag with explicit value" }, + { input: "--noQuiet", brief: "Negated flag" }, ], }, }); diff --git a/docs/docs/features/command-routing/commands.mdx b/docs/docs/features/command-routing/commands.mdx index 50af806..c9d07b3 100644 --- a/docs/docs/features/command-routing/commands.mdx +++ b/docs/docs/features/command-routing/commands.mdx @@ -68,7 +68,7 @@ The parameters object is a specification of all of the parameters (arguments and A base level of documentation is required, and more is always appreciated. All commands must specify a value for `brief` that contains a short line of text to be used when referring to this command throughout the help text of the application. -Optionally, you can further customize the help text for this specific command by including `fullDescription` or `customUsage`. The former will override `brief` in the command's help text and can contain multiple lines of text rather than just one. The `customUsage` property will replace the auto-generated usage lines, and is useful when there's some [additional validation of user inputs](../out-of-scope.mdx#cross-argument-validation) that isn't represented natively by Stricli. +Optionally, you can further customize the help text for this specific command by including `fullDescription` or `customUsage`. The former will override `brief` in the command's help text and can contain multiple lines of text rather than just one. The `customUsage` property will replace the auto-generated usage lines, and is useful when there's some [additional validation of user inputs](../out-of-scope.mdx#cross-argument-validation) that isn't represented natively by Stricli. You can also provide an object with `input` and `brief` to print a description after the usage line. ```ts // output-next-line @@ -84,6 +84,7 @@ buildCommand({ customUsage: [ "-a -b", "-c", + { input: "-d", brief: "Brief description of this use case" }, ], }, ... @@ -98,6 +99,8 @@ run --help USAGE run -a -b run -c + run -d + Brief description of this use case run --help This is the full description of the command. diff --git a/packages/core/tests/application.spec.ts b/packages/core/tests/application.spec.ts index e84cb78..398728d 100644 --- a/packages/core/tests/application.spec.ts +++ b/packages/core/tests/application.spec.ts @@ -674,7 +674,11 @@ describe("Application", () => { }, docs: { brief: "basic command", - customUsage: ["custom usage 1", { input: "custom-two", brief: "enhanced custom usage 2" }, "custom usage 3"], + customUsage: [ + "custom usage 1", + { input: "custom-two", brief: "enhanced custom usage 2" }, + "custom usage 3", + ], }, }); const appWithAlternateUsage = buildApplication(commandWithAlternateUsage, {