Module

PuduLangDocgen.Command.Arguments

View source

Command lines read into commands, paths, and options

Types

Name Description
Parsed A command, its positional arguments, and its options

Functions

Name Description
parse Command-line arguments read into a command, positional arguments, and options.
usage Help text listing commands and options.
has Whether a flag was given.
valueOf The last value given for an option, or the fallback.
valuesOf Every value given for an option, in order.
configPath A configuration path; a folder names its `docgen.json`.

parse

fn parse(arguments: &Array[Str]) -> Result[Parsed, Str]

Command-line arguments read into a command, positional arguments, and options.

Parameters

arguments
&Array[Str]

Returns

Result[Parsed, Str]

View source

usage

fn usage() -> Str

Help text listing commands and options.

Returns

Str

View source

has

fn has(parsed: &Parsed, flag: Str) -> Bool

Whether a flag was given.

Parameters

parsed
&Parsed
flag
Str

Returns

Bool

View source

valueOf

fn valueOf(parsed: &Parsed, name: Str, fallback: Str) -> Str

The last value given for an option, or the fallback.

Parameters

parsed
&Parsed
name
Str
fallback
Str

Returns

Str

View source

valuesOf

fn valuesOf(parsed: &Parsed, name: Str) -> Array[Str]

Every value given for an option, in order.

Parameters

parsed
&Parsed
name
Str

Returns

Array[Str]

View source

configPath

fn configPath(written: Str) -> Str

A configuration path; a folder names its docgen.json.

Parameters

written
Str

Returns

Str

View source