Skip to content

Commit 26820cd

Browse files
committed
Updated documentation about persistent history files
1 parent 4661f86 commit 26820cd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/features/history.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ the parsed :class:`cmd2.Statement` is appended to :data:`cmd2.Cmd.history`.
2020
``cmd2`` adds the option of making this history persistent via optional
2121
arguments to :meth:`cmd2.Cmd.__init__`. If you pass a filename in the
2222
``persistent_history_file`` argument, the contents of :data:`cmd2.Cmd.history`
23-
will be pickled into that history file. We chose to use pickle instead of plain
24-
text so that we can save the results of parsing all the commands.
23+
will be written as compressed JSON to that history file. We chose this format
24+
instead of plain text to preserve the complete :class:`cmd2.Statement` object
25+
for each command.
2526

2627
.. note::
2728

@@ -41,9 +42,7 @@ The :data:`cmd2.Cmd.history` attribute, the :class:`cmd2.history.History`
4142
class, and the :class:`cmd2.history.HistoryItem` class are all part of the
4243
public API for :class:`cmd2.Cmd`. You could use these classes to implement
4344
write your own ``history`` command (see below for documentation on how the
44-
included ``history`` command works). If you don't like pickled history, you
45-
could implement your own mechanism for saving and loading history from a plain
46-
text file.
45+
included ``history`` command works).
4746

4847

4948
For Users

0 commit comments

Comments
 (0)