* Added -K option to start with KanjiDic, but still open word dictionary window.
authorUrban Wallasch <urban.wallasch@freenet.de>
Sat, 26 Jun 2021 13:18:08 +0000 (15:18 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Sat, 26 Jun 2021 13:18:08 +0000 (15:18 +0200)
README.md
jiten-pai.py

index a19098cd3f5bd8f914eed2fdc0e3cfaba9d2fa78..ed094d0b18eec9bcf5fa784d76e1902cf88c988e 100644 (file)
--- 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
index 2d8dd4d0a052250eb4644b0bd17d02561f444f26..a8eb83a3c90fa7731f6a05eed79f397619a5f4d4 100755 (executable)
@@ -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')