From: K.Kosako Date: Fri, 14 Sep 2018 05:38:08 +0000 (+0900) Subject: add a command line option '-gc' for make_unicode_property_data.py X-Git-Tag: v6.9.1~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=310fb8633ce4c115c4a167d5a664fa321ca689ab;p=onig add a command line option '-gc' for make_unicode_property_data.py --- diff --git a/src/make_unicode_property_data.py b/src/make_unicode_property_data.py index 9a48ced..4254262 100755 --- a/src/make_unicode_property_data.py +++ b/src/make_unicode_property_data.py @@ -6,8 +6,6 @@ import sys import re -INCLUDE_GRAPHEME_CLUSTER_DATA = False - POSIX_LIST = [ 'NEWLINE', 'Alpha', 'Blank', 'Cntrl', 'Digit', 'Graph', 'Lower', 'Print', 'Punct', 'Space', 'Upper', 'XDigit', 'Word', 'Alnum', 'ASCII' @@ -427,9 +425,17 @@ argv = sys.argv argc = len(argv) POSIX_ONLY = False -if argc >= 2: - if argv[1] == '-posix': +INCLUDE_GRAPHEME_CLUSTER_DATA = False + +for i in range(1, argc): + arg = argv[i] + if arg == '-posix': POSIX_ONLY = True + elif arg == '-gc': + INCLUDE_GRAPHEME_CLUSTER_DATA = True + else: + print >> sys.stderr, "Invalid argument: %s" % arg + OUTPUT_LIST_MODE = not(POSIX_ONLY)