@@ -15,8 +15,14 @@ get a `!` shortcut for `shell`, which allows you to type:
15
15
16
16
(Cmd) !ls -al
17
17
18
- NOTE: ` cmd2 ` provides user-friendly tab completion throughout the process of running a shell
19
- command - first for the shell command name itself, and then for file paths in the argument section.
18
+ !!! note
19
+
20
+ `cmd2` provides user-friendly tab completion throughout the process of running a shell command -
21
+ first for the shell command name itself, and then for file paths in the argument section.
22
+
23
+ However, a `cmd2` application effectively **becomes** the shell, so if you have _extra_ shell
24
+ completion configured for your particular shell such as `bash`, `zsh`, `fish`, etc. then this
25
+ will not be available within `cmd2`.
20
26
21
27
## Editors
22
28
@@ -36,16 +42,18 @@ system.
36
42
37
43
## Terminal pagers
38
44
39
- Output of any command can be displayed one page at a time using the ` cmd2.Cmd.ppaged ` method.
45
+ Output of any command can be displayed one page at a time using the [ cmd2.Cmd.ppaged] [ ] method.
40
46
41
47
Alternatively, a terminal pager can be invoked directly using the ability to run shell commands with
42
48
the ` ! ` shortcut like so:
43
49
44
50
(Cmd) !less foo.txt
45
51
46
- NOTE: Once you are in a terminal pager, that program temporarily has control of your terminal,
47
- ** NOT** ` cmd2 ` . Typically you can use either the arrow keys or ` <PageUp> ` /` <PageDown> ` keys to
48
- scroll around or type ` q ` to quit the pager and return control to your ` cmd2 ` application.
52
+ !!! warning
53
+
54
+ Once you are in a terminal pager, that program temporarily has control of your terminal,
55
+ **NOT** `cmd2`. Typically you can use either the arrow keys or `<PageUp>`/`<PageDown>` keys to
56
+ scroll around or type `q` to quit the pager and return control to your `cmd2` application.
49
57
50
58
## Exit codes
51
59
@@ -87,10 +95,10 @@ shell, and execute those commands before entering the command loop:
87
95
88
96
$ python examples/transcript_example.py help
89
97
90
- Documented commands (use 'help -v' for verbose/'help <topic>' for details):
91
- ===========================================================================
92
- alias help macro orate quit run_script set shortcuts
93
- edit history mumble py run_pyscript say shell speak
98
+ Documented Commands
99
+ ───────────────────
100
+ alias help macro orate run_pyscript say shell speak
101
+ edit history mumble quit run_script set shortcuts
94
102
95
103
(Cmd)
96
104
@@ -111,8 +119,9 @@ shell, but have it say it in pig latin:
111
119
Uh-oh, that's not what we wanted. ` cmd2 ` treated ` -p ` , ` hello ` , and ` there ` as commands, which don't
112
120
exist in that program, thus the syntax errors.
113
121
114
- There is an easy way around this, which is demonstrated in ` examples/cmd_as_argument.py ` . By setting
115
- ` allow_cli_args=False ` you can do your own argument parsing of the command line:
122
+ There is an easy way around this, which is demonstrated in
123
+ [ cmd_as_argument.py] ( https://github.com/python-cmd2/cmd2/blob/main/examples/cmd_as_argument.py )
124
+ example. By setting ` allow_cli_args=False ` you can do your own argument parsing of the command line:
116
125
117
126
$ python examples/cmd_as_argument.py speak -p hello there
118
127
ellohay heretay
0 commit comments