From 8190836af60cc703886ac2ad4bf37ae0ba13786d Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Sat, 26 Jun 2021 15:18:08 +0200 Subject: [PATCH] * Added -K option to start with KanjiDic, but still open word dictionary window. --- README.md | 3 ++- jiten-pai.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a19098c..ed094d0 100644 --- a/README.md +++ b/README.md @@ -88,13 +88,14 @@ dictionary copyright information and licensing terms. Jiten-pai supports a few command line options which might come in handy for workflow integration. They should be fairly self explaining: ``` - usage: jiten-pai.py [-h] [-k] [-c] [-v] [-l KANJI] [-w WORD] + usage: jiten-pai.py [-h] [-k] [-K] [-c] [-v] [-l KANJI] [-w WORD] Jiten-pai Japanese dictionary optional arguments: -h, --help show this help message and exit -k, --kanjidic start with KanjiDic + -K same as -k, but word dictionary visible -c, --clip-kanji look up kanji from clipboard -v, --clip-word look up word from clipboard -l KANJI, --kanji-lookup KANJI look up KANJI in kanji dictionary diff --git a/jiten-pai.py b/jiten-pai.py index 2d8dd4d..a8eb83a 100755 --- a/jiten-pai.py +++ b/jiten-pai.py @@ -975,6 +975,9 @@ class jpMainWindow(QMainWindow): if cl_args is not None: if cl_args.kanjidic: self.kanjidic() + elif cl_args.K: + self.show() + self.kanjidic() elif cl_args.kanji_lookup: self.kanjidic(cl_args.kanji_lookup) elif cl_args.clip_kanji: @@ -1484,6 +1487,7 @@ def _parse_cmdline(): epilog='Only one of these options should be used at a time.\n' ) parser.add_argument('-k', '--kanjidic', action='count', help='start with KanjiDic') + parser.add_argument('-K', action='count', help='same as -k, but word dictionary visible') parser.add_argument('-c', '--clip-kanji', action='count', help='look up kanji from clipboard') parser.add_argument('-v', '--clip-word', action='count', help='look up word from clipboard') parser.add_argument('-l', '--kanji-lookup', metavar='KANJI', help='look up KANJI in kanji dictionary') -- 2.30.2