ReadFlagsOptions
External state and behavior toggles accepted by readFlags.
Extends ResolveOptions, so env, config, prompter, stat, and mkdir carry the meaning they have during command resolution.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/read-flags/index.ts - Source link:
src/core/read-flags/index.ts:47
Signatures
interface ReadFlagsOptions extends ResolveOptions {}Members
Properties
adapter
Runtime source for argv, environment, and filesystem primitives.
adapter?: RuntimeAdapter;argv
User arguments only, without the binary and script entries.
argv?: readonly string[];config
Parsed config file contents keyed by dotted path segments.
config?: Readonly<Record<string, unknown>>;env
Environment variable snapshot injected by the caller.
env?: Readonly<Record<string, string | undefined>>;help
The built-in --help/-h handling.
While 'on', a pre-separator --help or -h prints generated help for the definitions to the adapter's stdout and exits the process with code 0. The built-in yields automatically when any definition claims the help or h spelling through its name, an alias, a negated form, or a case-parity counterpart; those spellings then parse as the definition's own. 'off' removes the built-in, and the spellings parse like any other token.
help?: "on" | "off";mkdir
Recursive directory creation for flag.path() and arg.path() create checks. When absent, missing paths are not created and existence rules apply as-is.
mkdir?: { (path: string): Promise<void>; };onDeprecation
Receiver for notices produced by .deprecated() flags.
onDeprecation?: { (warning: DeprecationWarning): void; };parse
Parser behavior such as kebab/camel case parity.
parse?: ParseOptions;prompter
Interactive prompt engine; absent in non-TTY / CI contexts.
prompter?: PromptEngine;stat
Filesystem probe for flag.path() and arg.path() checks: what exists at the path, or null when nothing does. When absent, path checks are skipped.
stat?: { (path: string): Promise<"file" | "directory" | null>; };stdinData
Pre-read stdin content, or null when stdin was not piped.
stdinData?: string | null;strict
Reject argv content the definitions do not declare.
false drops undeclared input from argv before parsing: unknown long flags together with their inline =value, unknown characters inside a short group, positional arguments, and the -- separator, which can only introduce positionals here. A value token of a declared flag is kept by walking the same consumption rules the parser applies. Misuse of a declared flag still fails: a missing value, a bad coercion, or a violated duplicate policy throws in either mode.
strict?: boolean;