Example#

class graftkit.Example[source]#

Bases: FrozenModel

A command line that runs a command, shown in --help and --describe.

The app checks every example against the command’s parser when it is built, so an example that no longer parses fails at once instead of misleading its reader.

Attributes:
argvtuple[str, …]

The arguments after the program and command names, one string each, e.g. ("--name", "billing").

saysstr

What the example does, in one sentence.

Methods

shell(command_line)

Return the example as a shell command line.

shell(command_line: str) → str[source]#

Return the example as a shell command line.

Parameters:
command_linestr

How the command is invoked, e.g. mytool deploy.

Returns:
str

The command line with the example’s arguments quoted for a POSIX shell.