diff --git a/package.json b/package.json index cb63ab6..8c2a97b 100755 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@drizzle-team/brocli", "type": "module", "author": "Drizzle Team", - "version": "0.3.0", + "version": "0.4.0", "description": "Typed CLI command runner", "license": "Apache-2.0", "sideEffects": false, diff --git a/src/command-core.ts b/src/command-core.ts index f8132c2..d416c84 100755 --- a/src/command-core.ts +++ b/src/command-core.ts @@ -247,7 +247,11 @@ const validateOptions = name === namePart); diff --git a/src/index.ts b/src/index.ts index 5522d57..55264bf 100755 --- a/src/index.ts +++ b/src/index.ts @@ -3,9 +3,11 @@ export type { AnyRawCommand, BroCliConfig, Command, + CommandCandidate, CommandHandler, GenericCommandHandler, HelpHandler, + InnerCommandParseRes, RawCommand, RawCommandWithPositionals, RawCommandWithSubcommands, diff --git a/src/option-builder.ts b/src/option-builder.ts index ac4228c..786211f 100755 --- a/src/option-builder.ts +++ b/src/option-builder.ts @@ -400,7 +400,7 @@ export function number(): Omit< OptionType | 'enum' >; export function number(name?: TName) { - return typeof name === 'number' ? new OptionBuilderBase().number(name) : new OptionBuilderBase().number(); + return typeof name === 'string' ? new OptionBuilderBase().number(name) : new OptionBuilderBase().number(); } export function boolean( @@ -442,7 +442,7 @@ export function positional(): Omit< OptionType | 'min' | 'max' | 'int' | 'alias' >; export function positional(displayName?: string) { - return typeof displayName === 'number' + return typeof displayName === 'string' ? new OptionBuilderBase().positional(displayName) : new OptionBuilderBase().positional(); }