Expand description
Global framework flags and flag-extraction helpers.
Structs§
- Global
Flags - Parsed framework-global flags.
Enums§
- Interactivity
Mode - Interactivity mode for a CLI invocation.
Functions§
- app_
id_ env_ prefix - Sanitizes an app id into an environment-variable prefix: ASCII alphanumerics
are uppercased and every other character becomes
_, e.g.godaddy->GODADDY,my-cli->MY_CLI. - debug_
component_ enabled - Reports whether a
--debugpattern enables a named component. - default_
output_ format - Computes the default output format for
app_id, consulting the${APP_ID}_OUTPUTenv override, the[output].formatkey inconfig.toml, and whether stdout is an interactive terminal. Used as the fallback when no explicit--output/--json/--toon/--humanis given. - derive_
bool_ flags - Derives flag names that do not consume the following token.
- derive_
value_ flags - Derives flag names that consume the following token.
- detect_
interactive - Returns
truewhen the process appears to be running interactively: stdin and stderr are both TTYs. - extract_
command_ path - Extracts a colon-separated command path from raw args.
- extract_
output_ format - Extracts output format from raw args.
- global_
flags_ from_ matches - Extracts framework-global flags from parsed
clapmatches, falling back todefault_formatwhen the user gave no explicit output format. - has_
true_ schema_ flag - Reports whether raw args contain a true
--schemaflag. - min_
stage_ env_ var - Derives the per-application global minimum-stage override env var from an
app id, e.g.
godaddy->GODADDY_MIN_STAGE,gdx->GDX_MIN_STAGE. - output_
env_ var - Derives the per-application output-format override env var from an app id,
e.g.
godaddy->GODADDY_OUTPUT,gdx->GDX_OUTPUT. - register_
global_ flags - Registers framework-global flags on a
clapcommand. - register_
reason_ flag - Registers the
--reasonflag on aclapcommand. - resolve_
default_ output_ format - Resolves the default output format when the user gave no explicit format.