fix: Modify command to support variadic positional args (#2317)
This commit is contained in:
@@ -11,6 +11,7 @@ ignorePaths:
|
||||
- patches/**
|
||||
- '**/*.snap'
|
||||
- docs/assets/extension-showcase.yml
|
||||
- packages/*/stats.html
|
||||
words:
|
||||
- Aabid
|
||||
- aabidk
|
||||
@@ -21,6 +22,7 @@ words:
|
||||
- buildc
|
||||
- bunx
|
||||
- cachable
|
||||
- cacjs
|
||||
- charmbracelet
|
||||
- chromedriver
|
||||
- Cira
|
||||
|
||||
@@ -82,8 +82,12 @@ export function createAliasedCommand(
|
||||
bin: string,
|
||||
docsUrl: string,
|
||||
) {
|
||||
// Declare a variadic positional arg so cac forwards subcommands like `wxt
|
||||
// submit init` instead of rejecting them as unused args. `.allowUnknownOptions`
|
||||
// only relaxes flag checks, not positional args. Required since cac@7, which
|
||||
// throws on unused positional args (see cacjs/cac#135).
|
||||
const aliasedCommand = base
|
||||
.command(name, `Alias for ${alias} (${docsUrl})`)
|
||||
.command(`${name} [...args]`, `Alias for ${alias} (${docsUrl})`)
|
||||
.allowUnknownOptions()
|
||||
.action(async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user