Show More
@@ -117,6 +117,7 def main(): | |||||
117 | # and the next best thing to real 'ls -F' |
|
117 | # and the next best thing to real 'ls -F' | |
118 | ip.defalias('d','dir /w /og /on') |
|
118 | ip.defalias('d','dir /w /og /on') | |
119 |
|
119 | |||
|
120 | ip.set_hook('input_prefilter', dotslash_prefilter_f) | |||
120 | extend_shell_behavior(ip) |
|
121 | extend_shell_behavior(ip) | |
121 |
|
122 | |||
122 | class LastArgFinder: |
|
123 | class LastArgFinder: | |
@@ -138,9 +139,15 class LastArgFinder: | |||||
138 | return parts[-1] |
|
139 | return parts[-1] | |
139 | return "" |
|
140 | return "" | |
140 |
|
141 | |||
141 |
|
142 | def dotslash_prefilter_f(self,line): | ||
142 |
|
143 | """ ./foo now runs foo as system command | ||
143 |
|
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 | # XXX You do not need to understand the next function! |
|
152 | # XXX You do not need to understand the next function! | |
146 | # This should probably be moved out of profile |
|
153 | # This should probably be moved out of profile |
@@ -29,6 +29,7 New features | |||||
29 | Development Team" as the copyright holder. We give more details about exactly |
|
29 | Development Team" as the copyright holder. We give more details about exactly | |
30 | what this means in this file. All developer should read this and use the new |
|
30 | what this means in this file. All developer should read this and use the new | |
31 | banner in all IPython source code files. |
|
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 | Bug fixes |
|
34 | Bug fixes | |
34 | --------- |
|
35 | --------- |
General Comments 0
You need to be logged in to leave comments.
Login now