diff --git a/src/command-core.ts b/src/command-core.ts index e2899de..48054d0 100755 --- a/src/command-core.ts +++ b/src/command-core.ts @@ -325,9 +325,7 @@ export const command = < >(command: RawCommand): Command> => { const allNames = command.aliases ? [command.name, ...command.aliases] : [command.name]; - const processedOptions = command.options ? validateOptions(command.options) : undefined; const cmd: Command = clone(command) as any; - if ( ( command).subcommands && command.options && Object.values(command.options).find((opt) => opt._.config.type === 'positional') @@ -336,6 +334,8 @@ export const command = < `Can't define command '${cmd.name}' - command can't have subcommands and positional args at the same time!`, ); } + + const processedOptions = command.options ? validateOptions(command.options) : undefined; cmd.options = processedOptions; cmd.name = cmd.name ?? cmd.aliases?.shift();