From 6e97295623afade92506bb211f115e9f3884c675 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 1 Sep 2019 17:46:18 -0400 Subject: [PATCH] rename --- README.md | 2 +- string_compiler.py => hystricomorph.py | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) rename string_compiler.py => hystricomorph.py (96%) diff --git a/README.md b/README.md index 41b5155..45cf0e1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Generates code to match an input string against one or more target strings. ## Usage - python3 string_compiler.py [-ilvE] [-o outfile_file] function_name [input_file] + python3 hystricomorph.py [-ilvE] [-o outfile_file] function_name [input_file] -i case insensitive comparison -E run input file through c pre-processor diff --git a/string_compiler.py b/hystricomorph.py similarity index 96% rename from string_compiler.py rename to hystricomorph.py index 390aeaf..fee7839 100644 --- a/string_compiler.py +++ b/hystricomorph.py @@ -155,15 +155,6 @@ def encode_string(s): return "".join([encode_map.get(x, x) for x in s]) -def usage(ex=1): - print("Usage: string_compiler [-cilvE] [-o output_file] function_name [input_file]") - print(" -c add implicit 0-terminator to strings") - print(" -i case insensitive") - print(" -l include string length in lsb of return value") - print(" -v be verbose") - print(" -E use c pre-processor") - print(" -o output_file specify output file") - sys.exit(ex) def read_data(f, name): @@ -274,6 +265,15 @@ def init_maps(): encode_map[chr(11)] = '\\v' +def usage(ex=1): + print("Usage: hystricomorph [-cilvE] [-o output_file] function_name [input_file]") + print(" -c add implicit 0-terminator to strings") + print(" -i case insensitive") + print(" -l include string length in lsb of return value") + print(" -v be verbose") + print(" -E use c pre-processor") + print(" -o output_file specify output file") + sys.exit(ex) def main(): global flag_i, flag_l, flag_E, flag_c @@ -284,12 +284,6 @@ def main(): argv = sys.argv[1:] opts, args = getopt.getopt(argv, "ivo:leEc") - # flags = {} - # for k, v in opts: flags[k] = v - # # booleans - # for k in ("-i","-v","-l","-e"): - # flags[k] = k in flags - for k, v in opts: if k == '-i': flag_i = True elif k == '-o': flag_o = v