Show More
@@ -21,7 +21,7 b' from argparse import Action' | |||||
21 | # Our own packages |
|
21 | # Our own packages | |
22 | from IPython.core.error import StdinNotImplementedError |
|
22 | from IPython.core.error import StdinNotImplementedError | |
23 | from IPython.core.magic import Magics, magics_class, line_magic |
|
23 | from IPython.core.magic import Magics, magics_class, line_magic | |
24 | from IPython.core.magic_arguments import (argument, magic_arguments, |
|
24 | from IPython.core.magic_arguments import (argument, defaults, magic_arguments, | |
25 | parse_argstring) |
|
25 | parse_argstring) | |
26 | from IPython.testing.skipdoctest import skip_doctest |
|
26 | from IPython.testing.skipdoctest import skip_doctest | |
27 | from IPython.utils import io |
|
27 | from IPython.utils import io | |
@@ -93,6 +93,7 b' class HistoryMagics(Magics):' | |||||
93 | arg, or the default is the last 10 lines. |
|
93 | arg, or the default is the last 10 lines. | |
94 | """) |
|
94 | """) | |
95 | @argument('range', nargs='*') |
|
95 | @argument('range', nargs='*') | |
|
96 | @defaults(limit_specified=False) | |||
96 | @skip_doctest |
|
97 | @skip_doctest | |
97 | @line_magic |
|
98 | @line_magic | |
98 | def history(self, parameter_s = ''): |
|
99 | def history(self, parameter_s = ''): | |
@@ -173,7 +174,7 b' class HistoryMagics(Magics):' | |||||
173 | hist = history_manager.search(pattern, raw=raw, output=get_output, |
|
174 | hist = history_manager.search(pattern, raw=raw, output=get_output, | |
174 | n=args.limit) |
|
175 | n=args.limit) | |
175 | print_nums = True |
|
176 | print_nums = True | |
176 |
elif |
|
177 | elif args.limit_specified: | |
177 | n = 10 if args.limit is None else args.limit |
|
178 | n = 10 if args.limit is None else args.limit | |
178 | hist = history_manager.get_tail(n, raw=raw, output=get_output) |
|
179 | hist = history_manager.get_tail(n, raw=raw, output=get_output) | |
179 | else: |
|
180 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now