chewing / libchewing

libchewing - The intelligent phonetic input method library
https://chewing.im/
GNU Lesser General Public License v2.1
360 stars 90 forks source link

chewing-cli should allow me to find my user dictionary #528

Closed kanru closed 4 months ago

kanru commented 5 months ago

Is your feature request related to a problem? Please describe.

Currently to use chewing-cli to inspect my user dictionary I need to know the path. The path is different on each platform. The tool should be able to find them directly and let me know the path.

Describe the solution you'd like

Make the <PATH> argument optional to chewing-cli info so it prints the default path and dictionary

$ chewing-cli info -u
Path      : /var/home/kanru/.chewing/chewing.dat
Name      : 我的詞庫
Version   : 0.0.0
Copyright : Unknown
License   : Unknown
Software  : chewing 0.7.0-beta.2

$ chewing-cli info -j -u
{
  "path": "var/home/kanru/.chewing/chewing.dat",
  "name": "我的詞庫",
  "version": "0.0.0",
  "copyright": "Unknown",
  "license": "Unknown",
  "software": "chewing 0.7.0-beta.2"
}

Add subcommand export and import to directly import / export user dictionary.

Describe alternatives you've considered

no

Additional context

So that we don't need chewing-editor to edit user dictionary and everyone knows how to edit CSV files.