diff options
-rwxr-xr-x | README.md | 2 | ||||
-rw-r--r-- | cmd2/cmd2.py | 4 | ||||
-rw-r--r-- | docs/settingchanges.rst | 6 | ||||
-rwxr-xr-x | setup.py | 2 |
4 files changed, 6 insertions, 8 deletions
@@ -31,7 +31,7 @@ Main Features - Multi-line commands - Special-character command shortcuts (beyond cmd's `?` and `!`) - Command aliasing similar to bash `alias` command -- Macros, which are similar to aliases, but can take arguments when called +- Macros, which are similar to aliases, but they can contain argument placeholders - Ability to load commands at startup from an initialization script - Settable environment parameters - Parsing commands with arguments using `argparse`, including support for sub-commands diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index d6da8b2b..15175123 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2431,7 +2431,7 @@ class Cmd(cmd.Cmd): # Top-level parser for macro macro_description = ("Manage macros\n" "\n" - "A macro is similar to an alias, but it can take arguments when called.") + "A macro is similar to an alias, but it can contain argument placeholders.") macro_epilog = ("See also:\n" " alias") macro_parser = ACArgumentParser(description=macro_description, epilog=macro_epilog, prog='macro') @@ -2443,7 +2443,7 @@ class Cmd(cmd.Cmd): macro_create_help = "create or overwrite a macro" macro_create_description = "Create or overwrite a macro" - macro_create_epilog = ("A macro is similar to an alias, but it can take arguments when called.\n" + macro_create_epilog = ("A macro is similar to an alias, but it can contain argument placeholders.\n" "Arguments are expressed when creating a macro using {#} notation where {1}\n" "means the first argument.\n" "\n" diff --git a/docs/settingchanges.rst b/docs/settingchanges.rst index 1399c9fe..e1c437e4 100644 --- a/docs/settingchanges.rst +++ b/docs/settingchanges.rst @@ -75,10 +75,8 @@ Macros ====== ``cmd2`` provides a feature that is similar to aliases called macros. The major difference between macros and aliases -is that macros are intended to take arguments when called. These can be useful if you need to run a complex command -frequently with different arguments that appear in various parts of the command. - -Arguments are expressed when creating a macro using {#} notation where {1} means the first argument. +is that macros can contain argument placeholders. Arguments are expressed when creating a macro using {#} notation +where {1} means the first argument. The following creates a macro called my_macro that expects two arguments: @@ -28,7 +28,7 @@ Main features: - Multi-line commands - Special-character command shortcuts (beyond cmd's `?` and `!`) - Command aliasing similar to bash `alias` command - - Macros, which are similar to aliases, but can take arguments when called + - Macros, which are similar to aliases, but they can contain argument placeholders - Ability to load commands at startup from an initialization script - Settable environment parameters - Parsing commands with arguments using `argparse`, including support for sub-commands |