diff --git a/IPython/Extensions/ipy_miscapps.py b/IPython/Extensions/ipy_miscapps.py new file mode 100644 index 0000000..e6f8e5b --- /dev/null +++ b/IPython/Extensions/ipy_miscapps.py @@ -0,0 +1,19 @@ +""" Completers for miscellaneous command line apps + +""" +import IPython.ipapi +ip = IPython.ipapi.get() +import os + +def surfraw_completer(self,cmdline): + """ Completer for 'surfraw' + + example:: + sr go => sr google + + """ + compl = [l.split(None,1)[0] for l in os.popen('sr -elvi')] + return compl + + +ip.set_hook('complete_command', surfraw_completer, str_key = 'sr') \ No newline at end of file