quarto call engine, quarto call build-ts-extension, and quarto call typst-gather --help are all missing --profile, while quarto call axe --help has it:
$ quarto call typst-gather --help
...
Options:
-h, --help - Show this help.
--init-config - Generate a starter typst-gather.toml in current directory
--log <file> - Path to log file
--log-level <level> - Log level (debug, info, warning, error, critical)
--log-format <format> - Log format (plain, json-stream)
--quiet - Suppress console output.
$ quarto call axe --help
...
--log <file> - Path to log file
--log-level <level> - Log level (debug, info, warning, error, critical)
--log-format <format> - Log format (plain, json-stream)
--quiet - Suppress console output.
--profile - Active project profile(s)
--profile is registered as a global option in appendProfileArg:
|
export function appendProfileArg(cmd: Command<any>): Command<any> { |
|
return cmd.option( |
|
"--profile", |
|
"Active project profile(s)", |
|
{ |
|
global: true, |
|
}, |
|
); |
This relies on cliffy's native global: true option inheritance, which per #8438 does not reliably reach every subcommand. appendLogOptions hit the same bug and works around it by manually forwarding the log/quiet options to every subcommand instead of trusting cliffy's inheritance:
|
// If there are subcommands, forward the log options |
|
// directly to the subcommands. Otherwise, just attach |
|
// to the outer command |
|
// |
|
// Fixes https://github.com/quarto-dev/quarto-cli/issues/8438 |
|
// |
|
// Include hidden subcommands (e.g. `quarto call axe`, which is `.hidden()` |
|
// while experimental): `.hidden()` only affects `--help` visibility, not |
|
// whether the subcommand should accept forwarded log options. |
|
const subCommands = cmd.getCommands(true); |
|
if (subCommands.length > 0) { |
|
subCommands.forEach((command) => { |
|
addLogOptions(command); |
|
}); |
|
return cmd; |
|
} else { |
|
return addLogOptions(cmd); |
|
} |
|
} |
appendProfileArg never got the same treatment, so it still depends on cliffy's inheritance and only reaches the last subcommand registered under call:
|
export const callCommand = new Command() |
|
.name("call") |
|
.description( |
|
"Access functions of Quarto subsystems such as its rendering engines.", |
|
) |
|
.action(() => { |
|
callCommand.showHelp(); |
|
Deno.exit(1); |
|
}) |
|
.command("engine", engineCommand) |
|
.command("build-ts-extension", buildTsExtensionCommand) |
|
.command("typst-gather", typstGatherCommand) |
|
// hidden while experimental: invocable, not advertised in `quarto call` help |
|
.command("axe", axeCommand); |
axe was added last (#14815) and is the only one that got --profile by coincidence. This also explains why quarto-web's automated reference docs lost --profile from quarto call typst-gather between v1.11.3 and v1.11.5, even though nothing in typst-gather's own command changed.
We could apply the same subcommand-forwarding pattern from appendLogOptions to appendProfileArg.
Related: #8438
quarto call engine,quarto call build-ts-extension, andquarto call typst-gather --helpare all missing--profile, whilequarto call axe --helphas it:--profileis registered as a global option inappendProfileArg:quarto-cli/src/quarto-core/profile.ts
Lines 35 to 42 in 97f222f
This relies on cliffy's native
global: trueoption inheritance, which per #8438 does not reliably reach every subcommand.appendLogOptionshit the same bug and works around it by manually forwarding the log/quiet options to every subcommand instead of trusting cliffy's inheritance:quarto-cli/src/core/log.ts
Lines 81 to 99 in 97f222f
appendProfileArgnever got the same treatment, so it still depends on cliffy's inheritance and only reaches the last subcommand registered undercall:quarto-cli/src/command/call/cmd.ts
Lines 7 to 20 in 97f222f
axewas added last (#14815) and is the only one that got--profileby coincidence. This also explains why quarto-web's automated reference docs lost--profilefromquarto call typst-gatherbetween v1.11.3 and v1.11.5, even though nothing intypst-gather's own command changed.We could apply the same subcommand-forwarding pattern from
appendLogOptionstoappendProfileArg.Related: #8438