# HG changeset patch # User HackEso # Date 1573774892 0 # Node ID dff0129e4a40c12823cab9794a82d4874ba028b3 # Parent e9fea593e7025636c06d1697f3aba0d762b7bfa6 fetch bin/whatis https://hack.esolangs.org/get/bin/whatis diff -r e9fea593e702 -r dff0129e4a40 bin/whatis --- a/bin/whatis Thu Nov 14 21:52:14 2019 +0000 +++ b/bin/whatis Thu Nov 14 23:41:32 2019 +0000 @@ -1,5 +1,5 @@ #!/usr/bin/python3 -import sys, re +import sys, os, re if len(sys.argv) <= 1: print("whatis what?") sys.exit(1) @@ -11,7 +11,7 @@ argorg.append(arg) argfoldv.append(arg.casefold()) foundv.append(False) - with open("/hackenv/share/whatis", errors="surrogateescape") as whatisdb: + with open(os.environ.get("HACKENV","/hackenv") + /share/whatis", errors="surrogateescape") as whatisdb: for line in whatisdb: parts = re.match(r"([^()]+)\(([0-9A-Z_a-z]+)\)", line) if parts: