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