Skip to content

Latest commit

 

History

History
67 lines (43 loc) · 2.12 KB

cmd.rst

File metadata and controls

67 lines (43 loc) · 2.12 KB

cmd2.Cmd

cmd2.Cmd

__init__

default_error

The error message displayed when a non-existent command is run. Default: {} is not a recognized command, alias, or macro

help_error

The error message displayed to the user when they request help for a command with no help defined. Default: No help on {}

prompt

The prompt issued to solicit input. The default value is (Cmd). See features/prompt:Prompt for more information.

continuation_prompt

The prompt issued to solicit input for the 2nd and subsequent lines of a multiline command <features/multiline_commands:Multiline Commands> Default: >.

echo

If True, output the prompt and user input before executing the command. When redirecting a series of commands to an output file, this allows you to see the command in the output.

settable

This dictionary contains the name and description of all settings available to users.

Users use the features/builtin_commands:set command to view and modify settings. Settings are stored in instance attributes with the same name as the setting.

history

A record of previously entered commands.

This attribute is an instance of cmd2.history.History, and each command is an instance of cmd2.Statement.

statement_parser

An instance of cmd2.parsing.StatementParser initialized and configured appropriately for parsing user input.

intro

Set an introduction message which is displayed to the user before the features/hooks:Command Processing Loop begins.

py_bridge_name

The symbol name which features/scripting:Python Scripts run using the features/builtin_commands:run_pyscript command can use to reference the parent cmd2 application.