From 310fb8633ce4c115c4a167d5a664fa321ca689ab Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Fri, 14 Sep 2018 14:38:08 +0900 Subject: [PATCH] add a command line option '-gc' for make_unicode_property_data.py --- src/make_unicode_property_data.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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) -- 2.40.0