File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff 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
2121arguments 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`
4142class, and the :class: `cmd2.history.HistoryItem ` class are all part of the
4243public API for :class: `cmd2.Cmd `. You could use these classes to implement
4344write 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
4948For Users
You can’t perform that action at this time.
0 commit comments