do_what_aliaser.py 432 B

12345678910111213141516
  1. import sys
  2. if ( len(sys.argv) > 1 ):
  3. shell = sys.argv[1]
  4. if ( shell == "fish" ):
  5. print("function wh")
  6. print(" set -x DO_WHAT_SHELL fish")
  7. print(" python3 "+interpreter_location+" $argv | .")
  8. print("end")
  9. elif ( shell == "bash" or shell == "zsh" ):
  10. print("function wh {")
  11. print(" export DO_WHAT_SHELL="+shell)
  12. print(" source <(python3 "+interpreter_location+" $*)")
  13. print("}")
  14. else:
  15. print("No shell specified.")