Skip to main content
Module

x/allo_arguments/mod.ts>Arguments

🦕 Super handy cli argument parser with automate generation `--help` flag.
Latest
class Arguments
import { Arguments } from "https://deno.land/x/allo_arguments@v6.0.6/mod.ts";

Constructors

new
Arguments(flagOptions: T)

Type Parameters

T extends FlagOptionMap
optional
FlagValues = [longName in keyof T]: T[longName]["default"] extends () => infer U ? (ReturnType<T[longName]["convertor"]> extends U | undefined ? U : ReturnType<T[longName]["convertor"]> | U) : ReturnType<T[longName]["convertor"]>

Methods

getFlags(): Readonly<FlagValues>

Gets converted flag values.

isHelpRequested(): boolean

Gets boolean value indicating whether the help flag is requested.

If this method is called, the program will exit with the message and wait for the user to press any key.

setDescription(description: string)
deprecated
shouldHelp()

Prints the help message and exits the process.

Static Properties

booleanConvertor
numberConvertor
strictBooleanConvertor
strictNumberConvertor
strictStringConvertor
stringConvertor

Static Methods

Creates options of help flag.

isPrintableException(error: Error): boolean

Detect if the error is instance of PrintableException class.

Trows the error if it is not instance of PrintableException class.