- edited description
av/device: AVDevice Flags method
AVDevice implementations should be responsible for creating their own command-line flag vars, not their callers. In fact, strictly speaking, only the implementations need know what flags are acceptable to them.
Code such as the following:
exposurePtr = flag.String("Exposure", "auto", "Set exposure mode. ("+strings.Join(raspivid.ExposureModes[:], ",")+")")
autoWhiteBalancePtr = flag.String("Awb", "auto", "Set automatic white balance mode. ("+strings.Join(raspivid.AutoWhiteBalanceModes[:], ",")+")")
becomes simply:
raspipid.Flags()
Flags would create a FlagSet.
Callers then call Flags and Parse for each device package they intend to use. If Flags returns *FlagSet, then Parse() can be called, e.g.,:
raspipid.Flags().Parse()
geovision.Flags().Parse()
alsa.Flags().Parse()
An advantage of this approach is that each device has direct access to command-line flags and can configure itself accordingly.
Considerations:
Different devices may use the name flag names.
Comments (4)
-
reporter -
reporter Can we revisit moving the processing of flags from revid to AVDevice implementations@Saxon Milton ?
-
Can do @Alan Noble .
-
- changed status to resolved
This is no longer relevant as there is no command line version of revid.
- Log in to comment