##// END OF EJS Templates
Add -u argument to %history magic
Takafumi Arakaki -
Show More
@@ -89,6 +89,11 b' class HistoryMagics(Magics):'
89 get the last n lines from all sessions. Specify n as a single
89 get the last n lines from all sessions. Specify n as a single
90 arg, or the default is the last 10 lines.
90 arg, or the default is the last 10 lines.
91 """)
91 """)
92 @argument(
93 '-u', dest='unique', action='store_true',
94 help="""
95 when searching history using `-g`, show only unique history.
96 """)
92 @argument('range', nargs='*')
97 @argument('range', nargs='*')
93 @skip_doctest
98 @skip_doctest
94 @line_magic
99 @line_magic
@@ -165,7 +170,7 b' class HistoryMagics(Magics):'
165 else:
170 else:
166 pattern = "*"
171 pattern = "*"
167 hist = history_manager.search(pattern, raw=raw, output=get_output,
172 hist = history_manager.search(pattern, raw=raw, output=get_output,
168 n=limit)
173 n=limit, unique=args.unique)
169 print_nums = True
174 print_nums = True
170 elif args.limit is not _unspecified:
175 elif args.limit is not _unspecified:
171 n = 10 if limit is None else limit
176 n = 10 if limit is None else limit
General Comments 0
You need to be logged in to leave comments. Login now