Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/cliffy/flags/mod.ts>ParseFlagsOptions

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
interface ParseFlagsOptions
import { type ParseFlagsOptions } from "https://deno.land/x/cliffy@v1.0.0-rc.2/flags/mod.ts";

Parser options.

Type Parameters

optional
TFlagOptions extends FlagOptions = FlagOptions

Properties

optional
flags: Array<TFlagOptions>

An array of flag options.

optional
parse: TypeHandler<unknown>

Parser callback function for custom types.

optional
option: (option: TFlagOptions, value?: unknown) => void

Option callback function. Will be called for all parsed options.

optional
stopEarly: boolean

Enable stop early. If enabled, all arguments starting from the first non option argument will be added to the unknown array.

For example: command --debug-level warning server --port 80

Will result in: - flags: { debugLevel: 'warning' } - unknown: ['server', '--port', '80']

optional
stopOnUnknown: boolean

Works similar to stopEarly, bit stops on first unknown option or argument.

optional
allowEmpty: boolean

Don't throw an error when no arguments are passed to the parseFlags function.

optional
ignoreDefaults: Record<string, unknown>

Ignore default values for defined flags.

optional
dotted: boolean

Enable/disable dotted options. Default is true.