diff --git a/CHANGELOG.md b/CHANGELOG.md index 249625cd..f08e1c17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ time reading the [rich documentation](https://rich.readthedocs.io/). - `decorators` module breaking changes: - `_set_parser_prog` renamed to `set_parser_prog` (without the leading underscore) and moved to `argparse_custom` module + - Renamed history `--output_file` to `--output-file` to follow common command-line practices - Enhancements - Enhanced all print methods (`poutput()`, `perror()`, `ppaged()`, etc.) to natively render diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 430b9a10..0a9e3a3b 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -5029,7 +5029,7 @@ def _build_history_parser(cls) -> Cmd2ArgumentParser: history_action_group.add_argument('-e', '--edit', action='store_true', help='edit and then run selected history items') history_action_group.add_argument( '-o', - '--output_file', + '--output-file', metavar='FILE', help='output commands to a script file, implies -s', completer=cls.path_complete, diff --git a/docs/features/history.md b/docs/features/history.md index 5760bfd5..09b962b3 100644 --- a/docs/features/history.md +++ b/docs/features/history.md @@ -189,7 +189,7 @@ each command. This is great when displaying history to the screen because it giv reference to identify previously entered commands. However, when creating a script or a transcript, the command numbers would prevent the script from loading properly. The `-s` or `--script` option instructs the `history` command to suppress the line numbers. This option is automatically set by -the `--output_file`, `--transcript`, and `--edit` options. If you want to output the history +the `--output-file`, `--transcript`, and `--edit` options. If you want to output the history commands with line numbers to a file, you can do it with output redirection: (Cmd) history 1:4 > history.txt