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`.
20
20
``cmd2 `` adds the option of making this history persistent via optional
21
21
arguments to :meth: `cmd2.Cmd.__init__ `. If you pass a filename in the
22
22
``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.
25
26
26
27
.. note ::
27
28
@@ -41,9 +42,7 @@ The :data:`cmd2.Cmd.history` attribute, the :class:`cmd2.history.History`
41
42
class, and the :class: `cmd2.history.HistoryItem ` class are all part of the
42
43
public API for :class: `cmd2.Cmd `. You could use these classes to implement
43
44
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).
47
46
48
47
49
48
For Users
You can’t perform that action at this time.
0 commit comments