##// END OF EJS Templates
sh profile: ./foo runs 'foo' directly as system command
Ville M. Vainio -
Show More
@@ -117,6 +117,7 b' def main():'
117 117 # and the next best thing to real 'ls -F'
118 118 ip.defalias('d','dir /w /og /on')
119 119
120 ip.set_hook('input_prefilter', dotslash_prefilter_f)
120 121 extend_shell_behavior(ip)
121 122
122 123 class LastArgFinder:
@@ -138,9 +139,15 b' class LastArgFinder:'
138 139 return parts[-1]
139 140 return ""
140 141
141
142
143
142 def dotslash_prefilter_f(self,line):
143 """ ./foo now runs foo as system command
144
145 Removes the need for doing !./foo
146 """
147 import IPython.genutils
148 if line.startswith("./"):
149 return "_ip.system(" + IPython.genutils.make_quoted_expr(line)+")"
150 raise ipapi.TryNext
144 151
145 152 # XXX You do not need to understand the next function!
146 153 # This should probably be moved out of profile
@@ -29,6 +29,7 b' New features'
29 29 Development Team" as the copyright holder. We give more details about exactly
30 30 what this means in this file. All developer should read this and use the new
31 31 banner in all IPython source code files.
32 * sh profile: ./foo runs foo as system command, no need to do !./foo anymore
32 33
33 34 Bug fixes
34 35 ---------
General Comments 0
You need to be logged in to leave comments. Login now