CLStdHandler

CLStdHandler

class CLStdHandler[source]

Bases: configpile.handlers.CLHandler

The standard command line arguments handler

It processes arguments one by one. If it recognizes a flag, the corresponding handler is called. Otherwise, control is passed to the fallback handler, which by default processes positional parameters.

Attributes

Note: attributes inherited from parent classes are not shown here, if any

flags

fallback

Methods

handle

Processes arguments, possibly updating the state or returning errors

List of members of CLStdHandler

flags: Mapping[str, configpile.handlers.CLHandler]
fallback: configpile.handlers.CLHandler
handle(args, state)[source]

Processes arguments, possibly updating the state or returning errors

Parameters
  • args (Sequence[str]) – Command-line arguments not processed yet

  • state (State) – (Mutable) state to possibly update

Return type

Tuple[Sequence[str], Optional[Err]]

Returns

The updated command-line and an optional error

__init__(flags, fallback)