rm-hull / luma.examples

Companion repo for running examples against the luma.oled, luma.lcd, luma.led_matrix and luma.emulator display drivers.
MIT License
370 stars 144 forks source link

Command line description for --interface #96

Closed thomasw-mitutoyo-ctl closed 5 years ago

thomasw-mitutoyo-ctl commented 5 years ago

The help says that there's an optional parameter

[--interface]

Later it says

--interface , -i      Serial interface type. Allowed values are: i2c, spi,
                        bitbang (default: i2c)

So, if that parameter needs values, it should read

[--interface VALUE]

where VALUE can be replaced by i2c, spi or bitbang.

thomasw-mitutoyo-ctl commented 5 years ago

The same applies for --display, --rotate, --block-orientation, --mode, --framebuffer, --backlight-active and --transform

thijstriemstra commented 5 years ago

Probably related to the metavar='', e.g. https://github.com/rm-hull/luma.core/blob/master/luma/core/cmdline.py#L246 Not sure why metavar is used there.

thijstriemstra commented 5 years ago

Yea, removing metavar fixes it:

  --interface {i2c,spi,bitbang}, -i {i2c,spi,bitbang}
                        Serial interface type. Allowed values are: i2c, spi,
                        bitbang (default: i2c)

but introduces a lot of clutter. Specifying an uppercase metavar seems to produce desired result:

  --interface INTERFACE, -i INTERFACE
                        Serial interface type. Allowed values are: i2c, spi,
                        bitbang (default: i2c)

I'll create a PR.

thijstriemstra commented 5 years ago

The help says that there's an optional parameter

it's optional because you can use the --config parameter and specify all params there.