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

x/cliffy/flags/mod.ts>FlagOptions

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

Flag options.

Properties

name: string

The name of the flag.

optional
args: Array<ArgumentOptions>

An array of argument options.

optional
optionalValue: boolean

Mark argument as optional.

optional
aliases: string[]

Name aliases.

optional
standalone: boolean

If enabled, option cannot be combined with other options.

optional
default: DefaultValue

Default value.

optional
required: boolean

Mark flag as required.

optional
depends: string[]

An array of required flags that needs to be called together with this flag. If one of the flags is missing, an error will be thrown.

optional
conflicts: string[]

An array of conflicting flags that cannot be called together with this flag. If one of the flags is used together with this flag, an error will be thrown.

optional
value: ValueHandler

A callback function to map the flag value(s). The first argument if the callback function is the current value, and the second argument is an array of previous values when combined with the collect option.

optional
collect: boolean

If enabled, the flag can be used multiple times and all values will be collected into an array.

optional
equalsSign: boolean

If enabled, the argument must be assigned with an equals sign to the flag --flag=<value>, otherwise the value for this option will be ignored.