/** * Shared `--help` handling for every plugin CLI. * * Each CLI dispatches on `argv[0]` with a `switch`, so `--help` was only ever * recognized in the *subcommand position*. Once a subcommand matched, trailing * flags it did not know were ignored — and `install --help` ran a real install, * writing harness config, registering a marketplace, materializing a runtime, * and connecting against whatever `ORY_PROJECT_URL` / `ORY_OAUTH2_CLIENT_ID` * happened to be in the environment (#222/#221). * * ` --help` is universal muscle memory for "tell me about this, change * nothing", so it must never carry a side effect. */ /** * True when the user asked for usage anywhere in `args` rather than in the * subcommand slot — e.g. `install --help`, `local up -h`. * * Deliberately scans the whole tail: the point is that a help request must be * honored wherever it appears, not just where the dispatcher happens to look. * `--` ends the scan so a flag being *passed through* to something else is not * mistaken for a request to this CLI (`install -- --help`). */ export declare function wantsHelp(args: readonly string[]): boolean; /** * Guard for the top of a CLI's `main()`, after `argv` is split. * * Returns true when the CLI should print usage and do nothing else. Call it * *before* the dispatch switch: * * ```ts * const [command, ...args] = process.argv.slice(2); * if (shouldPrintHelp(command, args)) return help(); * ``` * * A bare `--help` / `help` / no command at all is left to the existing `switch` * arms, which already handle it; this only covers the case the dispatcher * cannot see — a help flag *after* a matched subcommand. */ export declare function shouldPrintHelp(command: string | undefined, args: readonly string[]): boolean;