CLPos

CLPos

class CLPos[source]

Bases: configpile.handlers.CLHandler

Handles positional parameters

Note that this handler has state, namely the positional parameters that are still expected.

Attributes

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

pos

(Mutable) list of positional parameters

Methods

handle

Processes arguments, possibly updating the state or returning errors

make

Constructs a positional parameter handler from a sequence of positional parameters

List of members of CLPos

pos: List[configpile.arg.Param[Any]]

(Mutable) list of positional parameters

static make(seq)[source]

Constructs a positional parameter handler from a sequence of positional parameters

Parameters

seq (Sequence[Param[Any]]) – Positional parameters

Return type

CLPos

Returns

Handler

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__(pos)