From bbb3fc0ccf29a61f4db00d9b1316e0f24936cca8 2013-11-14 21:35:37 From: Paul Ivanov Date: 2013-11-14 21:35:37 Subject: [PATCH] add --keep alias for history trim --- diff --git a/IPython/core/historyapp.py b/IPython/core/historyapp.py index e38f0d6..0e9eda3 100644 --- a/IPython/core/historyapp.py +++ b/IPython/core/historyapp.py @@ -30,9 +30,13 @@ class HistoryTrim(BaseIPythonApplication): flags = Dict(dict( backup = ({'HistoryTrim' : {'backup' : True}}, - "Keep the old history file as history.sqlite." + backup.get_metadata('help') ) )) + + aliases=Dict(dict( + keep = 'HistoryTrim.keep' + )) def start(self): profile_dir = self.profile_dir.location @@ -44,7 +48,7 @@ class HistoryTrim(BaseIPythonApplication): 'history ORDER BY session DESC, line DESC LIMIT ?', (self.keep+1,))) if len(inputs) <= self.keep: print("There are already at most %d entries in the history database." % self.keep) - print("Not doing anything.") + print("Not doing anything. Use --keep= argument to keep fewer entries") return print("Trimming history to the most recent %d entries." % self.keep)