do_what/do_what_aliaser.py
2018-11-30 14:23:45 -06:00

17 lines
432 B
Python

import sys
if ( len(sys.argv) > 1 ):
shell = sys.argv[1]
if ( shell == "fish" ):
print("function wh")
print(" set -x DO_WHAT_SHELL fish")
print(" python3 "+interpreter_location+" $argv | .")
print("end")
elif ( shell == "bash" or shell == "zsh" ):
print("function wh {")
print(" export DO_WHAT_SHELL="+shell)
print(" source <(python3 "+interpreter_location+" $*)")
print("}")
else:
print("No shell specified.")