Show More
@@ -302,6 +302,14 b' class HistoryMagics(Magics):' | |||||
302 | opts, args = self.parse_options(parameter_s, 'l:g:', mode='string') |
|
302 | opts, args = self.parse_options(parameter_s, 'l:g:', mode='string') | |
303 | if "l" in opts: # Last n lines |
|
303 | if "l" in opts: # Last n lines | |
304 | n = int(opts['l']) |
|
304 | n = int(opts['l']) | |
|
305 | ||||
|
306 | if n == 0: | |||
|
307 | print("Requested 0 last lines - nothing to run") | |||
|
308 | return | |||
|
309 | elif n < 0: | |||
|
310 | print("Number of lines to rerun cannot be negative") | |||
|
311 | return | |||
|
312 | ||||
305 | hist = self.shell.history_manager.get_tail(n) |
|
313 | hist = self.shell.history_manager.get_tail(n) | |
306 | elif "g" in opts: # Search |
|
314 | elif "g" in opts: # Search | |
307 | p = "*"+opts['g']+"*" |
|
315 | p = "*"+opts['g']+"*" |
General Comments 0
You need to be logged in to leave comments.
Login now