##// END OF EJS Templates
Implement __call__ for LA
Ville M. Vainio -
Show More
@@ -118,10 +118,12 b' def main():'
118 extend_shell_behavior(ip)
118 extend_shell_behavior(ip)
119
119
120 class LastArgFinder:
120 class LastArgFinder:
121 """ Allow $LA to work as "last argument of previous command, like $! in bash
121 """ Allow $LA to work as "last argument of previous command", like $! in bash
122
122
123 To call this in normal IPython code, do str(LA).
123 To call this in normal IPython code, do LA()
124 """
124 """
125 def __call__(self):
126 return str(self)
125 def __str__(self):
127 def __str__(self):
126 ip = ipapi.get()
128 ip = ipapi.get()
127 for cmd in reversed(ip.IP.input_hist_raw):
129 for cmd in reversed(ip.IP.input_hist_raw):
General Comments 0
You need to be logged in to leave comments. Login now