Open alexherbo2 opened 6 years ago
I’ve just pushed a patch to use click as the command-line parser, see commit https://github.com/fabi1cazenave/kalamine/commit/a229ee81cc925f9d3a79596355c423a50a1b25d7. Click looks promising but we’re not done yet — far from it.
Click nicely handles multiple values for an argument with the nargs=-1
trick, but there’s no easy way to handle multiple values for an option (though there are some workarounds). So for now, instead of using -in
and -out
, Kalamine uses an argument for the input and a single value for the output — and in fact, this suits all my use cases so far. Here are a couple examples of what works yet:
kalamine qwerty.yaml --out xkb
# qwerty.xkb
kalamine qwerty.yaml --out dist/lafayette.xkb
# dist/lafayette.xkb
kalamine qwerty42/fr.yaml --extends qwerty42.yaml --out all
# dist/qwerty42.keylayout
# dist/qwerty42.klc
# dist/qwerty42.xkb
# dist/xkb/fr/qwerty42
kalamine qwerty42/* --extends qwerty42.yaml --out klc
# qwerty42/de.klc
# qwerty42/es.klc
# qwerty42/fr.klc
# qwerty42/it.klc
(Note: --out all
is assumed by default, which is ugly… but handy in the short-term for the forward compatibility.)
Feedback is welcome.
Patches are welcome as well, especially to handle standard streams.
I’d happily merge a patch for the --out qwerty.{xkb,keylayout,klc}
trick, too. :-)
Shouldn’t this issue be closed ?
Usage
Formats
Input
yaml
: YAMLOutput
xkb
: XKB for Linuxkeylayout
: Keyboard Layouts for Macklc
: KLC for WindowsFiles
Input
-
: Refers to standard inputOutput
-
: Refers to standard outputExamples
Simple
Multiple outputs
Multiple inputs and outputs
Read and write from and to standard streams