2. Pypsi Builtin Commands

Pypsi ships with several commands that would be useful for any shell.

class pypsi.commands.echo.EchoCommand(name='echo', topic='shell', brief='print a line of text', **kwargs)[source]

Bases: pypsi.core.Command

Prints text to the screen.

class pypsi.commands.exit.ExitCommand(name='exit', topic='shell', brief='exit the shell', **kwargs)[source]

Bases: pypsi.core.Command

Exit the active shell.

class pypsi.commands.help.HelpCommand(name='help', topic='shell', brief='print information on a topic or command', topics=None, vars=None, **kwargs)[source]

Bases: pypsi.core.Command

Provides access to manpage-esque topics and command usage information.

class pypsi.commands.include.IncludeCommand(name='include', topic='shell', brief='execute a script file', **kwargs)[source]

Bases: pypsi.core.Command

Execute a script file. This entails reading each line of the given file and processing it as if it were typed into the shell.

class pypsi.commands.macro.MacroCommand(name='macro', topic='shell', brief='manage registered macros', macros=None, **kwargs)[source]

Bases: pypsi.plugins.block.BlockCommand

Record and execute command macros. Macros can consist of one or more command statements. Macros are comparable to Bash functions. Once a macro has been recorded, a new command is registered in the shell as an instance of a Macro.

This command requires the pypsi.plugins.block.BlockPlugin plugin.

class pypsi.commands.system.SystemCommand(name='system', topic='shell', use_shell=False, **kwargs)[source]

Bases: pypsi.core.Command

Execute a command on the parent shell. This command can be used as the shell’s fallback command.

fallback(shell, name, args)[source]

Pass the command to the parent shell.

class pypsi.commands.xargs.XArgsCommand(name='xargs', topic='shell', brief='build and execute command lines from stdin', **kwargs)[source]

Bases: pypsi.core.Command

Execute a command for each line of input from sys.stdin.