tokenize
Generated reference page for the tokenize function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/parse/index.ts - Source link:
packages/dreamcli/src/core/parse/index.ts:62
Signatures
ts
function tokenize(argv: readonly string[]): readonly Token[];| Parameter | Type | Description |
|---|---|---|
argv | readonly string[] | Raw argument strings to tokenize |
Members
Members
tokenize
Tokenize raw argv into structured tokens.
Low-level utility: most apps should use parse, cli().run(), or runCommand() instead of tokenizing manually. Reach for tokenize() when building custom tooling such as debuggers, inspectors, or parser tests.
Rules:
--→ separator (everything after is positional)--flag→ long flag, no inline value--flag=v→ long flag with inline value-abc→ short flags (expanded individually by parser)-→ positional (convention: stdin placeholder)- everything else → positional
ts
(argv: readonly string[]): readonly Token[];Examples
ts
tokenize(['deploy', '--force', '--region=eu', '-v']);