Skip to content

Commit 039ef29

Browse files
committed
Updated documentation. Added support for calling cmd2.Cmd.run_editor() with no argument.
1 parent 21cdab4 commit 039ef29

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
* On POSIX systems, shell commands and processes being piped to are now run in the user's preferred shell
5454
instead of /bin/sh. The preferred shell is obtained by reading the SHELL environment variable. If that
5555
doesn't exist or is empty, then /bin/sh is used.
56+
* Changed `cmd2.Cmd._run_editor()` to the public method `cmd2.Cmd.run_editor()`
5657

5758
## 1.5.0 (January 31, 2021)
5859
* Bug Fixes

cmd2/cmd2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4634,11 +4634,11 @@ def do_edit(self, args: argparse.Namespace) -> None:
46344634
"""Run a text editor and optionally open a file with it"""
46354635
self.run_editor(args.file_path)
46364636

4637-
def run_editor(self, file_path: Optional[str]) -> None:
4637+
def run_editor(self, file_path: Optional[str] = None) -> None:
46384638
"""
46394639
Run a text editor and optionally open a file with it
46404640
4641-
:param file_path: optional path of the file to edit
4641+
:param file_path: optional path of the file to edit. Defaults to None.
46424642
:raises: EnvironmentError if self.editor is not set
46434643
"""
46444644
if not self.editor:

docs/features/redirection.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ Disabling Redirection
6464
from cmd2 import Cmd
6565
class App(Cmd):
6666
def __init__(self):
67-
super().__init__()
68-
self.allow_redirection = False
67+
super().__init__(allow_redirection=False)
6968

7069
cmd2's parser will still treat the ``>``, ``>>``, and `|` symbols as output
7170
redirection and pipe symbols and will strip arguments after them from the

0 commit comments

Comments
 (0)