Grammalecte  Check-in [57bb3560a3]

Overview
Comment:[cli] show Python version
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | cli
Files: files | file ages | folders
SHA3-256: 57bb3560a3c647260fd134c2084f788fea9e4f0da1addfcf7a886155ffe4f753
User & Date: olr on 2019-08-20 13:00:03
Other Links: manifest | tags
Context
2019-08-20
16:31
[build] add tests to text processor actions to prevent weird bugs check-in: 7542272427 user: olr tags: trunk, build
13:00
[cli] show Python version check-in: 57bb3560a3 user: olr tags: trunk, cli
10:34
[core][fr] update readme check-in: 921b4fbc70 user: olr tags: trunk, fr, core
Changes

Modified grammalecte-cli.py from [54a739402e] to [5d7907fa10].

103
104
105
106
107
108
109



110
111
112
113
114
115
116
        return oJSON
    print("# Error: file <" + spf + "> not found.")
    return None


def main ():
    "launch the CLI (command line interface)"



    xParser = argparse.ArgumentParser()
    xParser.add_argument("-f", "--file", help="parse file (UTF-8 required!) [on Windows, -f is similar to -ff]", type=str)
    xParser.add_argument("-ff", "--file_to_file", help="parse file (UTF-8 required!) and create a result file (*.res.txt)", type=str)
    xParser.add_argument("-owe", "--only_when_errors", help="display results only when there are errors", action="store_true")
    xParser.add_argument("-j", "--json", help="generate list of errors in JSON (only with option --file or --file_to_file)", action="store_true")
    xParser.add_argument("-cl", "--concat_lines", help="concatenate lines not separated by an empty paragraph (only with option --file or --file_to_file)", action="store_true")
    xParser.add_argument("-tf", "--textformatter", help="auto-format text according to typographical rules (not with option --concat_lines)", action="store_true")







>
>
>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
        return oJSON
    print("# Error: file <" + spf + "> not found.")
    return None


def main ():
    "launch the CLI (command line interface)"

    print("Python v" + sys.version)

    xParser = argparse.ArgumentParser()
    xParser.add_argument("-f", "--file", help="parse file (UTF-8 required!) [on Windows, -f is similar to -ff]", type=str)
    xParser.add_argument("-ff", "--file_to_file", help="parse file (UTF-8 required!) and create a result file (*.res.txt)", type=str)
    xParser.add_argument("-owe", "--only_when_errors", help="display results only when there are errors", action="store_true")
    xParser.add_argument("-j", "--json", help="generate list of errors in JSON (only with option --file or --file_to_file)", action="store_true")
    xParser.add_argument("-cl", "--concat_lines", help="concatenate lines not separated by an empty paragraph (only with option --file or --file_to_file)", action="store_true")
    xParser.add_argument("-tf", "--textformatter", help="auto-format text according to typographical rules (not with option --concat_lines)", action="store_true")