interface CliOptions

CLI configuration options.

Every positional is optional, because every prefix of the argument list is a valid invocation; a missing value is undefined and makes the run incomplete rather than invalid.

Properties

readonly
package: string | undefined

Package specifier as typed, before resolveSpecifier.

readonly
coder: string | undefined

Coder name, absent when it is to be inferred or asked for.

readonly
command: string | undefined

Command word, absent when it is to be asked for.

readonly
help: boolean

Print guidance to stdout and exit 0 instead of to stderr and exit 1.

readonly
version: boolean

Print version information.

readonly
docs: boolean

Print deno doc output for the chosen coder instead of running it.

readonly
unknownFlags: readonly string[]

Flags the parser was given and does not know, as typed.

Not an aside: an unrecognised flag consumes a word, so the positionals behind it shift and a different word becomes the package. Nothing runs while this is non-empty.

readonly
blankSlots: readonly string[]

Slots filled with a word that says nothing, named as <package> and so on.

A blank argument is still an argument. Dropping it made the words after it mean something else — binstruct "" decode read decode as the package — which is the shift an unknown flag causes, by another route. Nothing runs while this is non-empty.

readonly
extraArgs: readonly string[]

Positionals beyond the third, as typed.

There are three slots and no fourth. A word past them was discarded in silence, so binstruct arp arpData decode input.bin — a forgotten < — sat reading a terminal with nothing to say it had ignored the file.

Usage

import { type CliOptions } from "cli.ts";