File tree 4 files changed +6
-8
lines changed
4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ Main Features
31
31
- Multi-line commands
32
32
- Special-character command shortcuts (beyond cmd's ` ? ` and ` ! ` )
33
33
- Command aliasing similar to bash ` alias ` command
34
- - Macros, which are similar to aliases, but can take arguments when called
34
+ - Macros, which are similar to aliases, but they can contain argument placeholders
35
35
- Ability to load commands at startup from an initialization script
36
36
- Settable environment parameters
37
37
- Parsing commands with arguments using ` argparse ` , including support for sub-commands
Original file line number Diff line number Diff line change @@ -2431,7 +2431,7 @@ def macro_list(self, args: argparse.Namespace) -> None:
2431
2431
# Top-level parser for macro
2432
2432
macro_description = ("Manage macros\n "
2433
2433
"\n "
2434
- "A macro is similar to an alias, but it can take arguments when called ." )
2434
+ "A macro is similar to an alias, but it can contain argument placeholders ." )
2435
2435
macro_epilog = ("See also:\n "
2436
2436
" alias" )
2437
2437
macro_parser = ACArgumentParser (description = macro_description , epilog = macro_epilog , prog = 'macro' )
@@ -2443,7 +2443,7 @@ def macro_list(self, args: argparse.Namespace) -> None:
2443
2443
macro_create_help = "create or overwrite a macro"
2444
2444
macro_create_description = "Create or overwrite a macro"
2445
2445
2446
- macro_create_epilog = ("A macro is similar to an alias, but it can take arguments when called .\n "
2446
+ macro_create_epilog = ("A macro is similar to an alias, but it can contain argument placeholders .\n "
2447
2447
"Arguments are expressed when creating a macro using {#} notation where {1}\n "
2448
2448
"means the first argument.\n "
2449
2449
"\n "
Original file line number Diff line number Diff line change @@ -75,10 +75,8 @@ Macros
75
75
======
76
76
77
77
``cmd2 `` provides a feature that is similar to aliases called macros. The major difference between macros and aliases
78
- is that macros are intended to take arguments when called. These can be useful if you need to run a complex command
79
- frequently with different arguments that appear in various parts of the command.
80
-
81
- Arguments are expressed when creating a macro using {#} notation where {1} means the first argument.
78
+ is that macros can contain argument placeholders. Arguments are expressed when creating a macro using {#} notation
79
+ where {1} means the first argument.
82
80
83
81
The following creates a macro called my_macro that expects two arguments:
84
82
Original file line number Diff line number Diff line change 28
28
- Multi-line commands
29
29
- Special-character command shortcuts (beyond cmd's `?` and `!`)
30
30
- Command aliasing similar to bash `alias` command
31
- - Macros, which are similar to aliases, but can take arguments when called
31
+ - Macros, which are similar to aliases, but they can contain argument placeholders
32
32
- Ability to load commands at startup from an initialization script
33
33
- Settable environment parameters
34
34
- Parsing commands with arguments using `argparse`, including support for sub-commands
You can’t perform that action at this time.
0 commit comments