Open davepl opened 3 weeks ago
BTW, I'm guessing it's because the options code expects everything to be preceded by --led, so --led-help works, but seems like a bug to me!
the rgb-matrix-flag parsing is done to least interfere with whatever the user needs in addition and processes with getopt()
, this is why all flags have the --led-*
prefix. The matrix does not go ahead and by itself print their usage of flags, as it is typically used inside another program that has their own flag processing and usage() print.
But the library provides a way to print its options that you can call inside your usage()
:
rgb_matrix::PrintMatrixFlags(stderr);
There are a couple of examples how flags are handled in the utils/
directory that might be helpful.
(BTW in your example I see that you first call the flags then set the runtime_opt.gpio_slowdown
. Typically one would do that the other way around as you'd set some useful defaults, but then allow the user to override them on the command line. Depends of course; sometimes one wants not to have a particular value messed up).
Below is my code to process options, but my expectation was that if the. user were to provide --help or -? that it would return false and hence print usage.
Is that not the case? Or do I have a bug?