Skip to content

Commit 4163383

Browse files
authored
Renamed history --output_file to --output-file to follow common command-line practices (#1527)
1 parent 279861d commit 4163383

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ time reading the [rich documentation](https://rich.readthedocs.io/).
3636
- `decorators` module breaking changes:
3737
- `_set_parser_prog` renamed to `set_parser_prog` (without the leading underscore) and moved
3838
to `argparse_custom` module
39+
- Renamed history `--output_file` to `--output-file` to follow common command-line practices
3940

4041
- Enhancements
4142
- Enhanced all print methods (`poutput()`, `perror()`, `ppaged()`, etc.) to natively render

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5029,7 +5029,7 @@ def _build_history_parser(cls) -> Cmd2ArgumentParser:
50295029
history_action_group.add_argument('-e', '--edit', action='store_true', help='edit and then run selected history items')
50305030
history_action_group.add_argument(
50315031
'-o',
5032-
'--output_file',
5032+
'--output-file',
50335033
metavar='FILE',
50345034
help='output commands to a script file, implies -s',
50355035
completer=cls.path_complete,

docs/features/history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ each command. This is great when displaying history to the screen because it giv
189189
reference to identify previously entered commands. However, when creating a script or a transcript,
190190
the command numbers would prevent the script from loading properly. The `-s` or `--script` option
191191
instructs the `history` command to suppress the line numbers. This option is automatically set by
192-
the `--output_file`, `--transcript`, and `--edit` options. If you want to output the history
192+
the `--output-file`, `--transcript`, and `--edit` options. If you want to output the history
193193
commands with line numbers to a file, you can do it with output redirection:
194194

195195
(Cmd) history 1:4 > history.txt

0 commit comments

Comments
 (0)