Skip to content

Commit

Permalink
Adding version arg
Browse files Browse the repository at this point in the history
  • Loading branch information
0xacb committed May 4, 2023
1 parent d7ab1ea commit 7c456d5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions recollapse
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import itertools
warnings.simplefilter("ignore")


VERSION = 0.2


class Recollapse:
ENCODING_URL = 1
ENCODING_UNICODE = 2
Expand Down Expand Up @@ -148,7 +151,7 @@ def parse_args():
parser.add_argument("-mn", "--maxnorm", help="maximum number of normalizations (default: 3)", default=3, type=int)
parser.add_argument("-nt", "--normtable", help="print normalization table", required=False, default=False, action="store_true")
parser.add_argument("input", help="original input", nargs="?")

parser.add_argument("--version", help="show viewgen version", required=False, action="store_true")
args = parser.parse_args()

if len(sys.argv) == 1:
Expand Down Expand Up @@ -183,7 +186,18 @@ def parse_args():
return args


if __name__ == "__main__":
args = parse_args()
def run_recollapse(args):
if args.version:
print("recollapse %s" % VERSION)
exit(0)

del args.version

recollapse = Recollapse(**vars(args))
recollapse.run()


if __name__ == "__main__":
args = parse_args()
run_recollapse(args)

0 comments on commit 7c456d5

Please sign in to comment.