(#6749) Implement support for options on strings and actions.
We want to support both strings and actions specifying options, to support
generic wrappers that present strings to the user across multiple distinct
front-ends.
At the moment we focus on implementation of a generic CLI providing full
control to all the strings, but we aim to support other programmatic
interfaces including Ruby and RPC invocation as part of the overall change.
We also detect, at the time they are declared, duplicate options. They are
reported, like any duplicate, with an error thrown. Specifically:
It is illegal to declare a duplicate option in the same scope, such as within
the same string, or within the same action. This is unchanged.
It is illegal to declare an option in an action that duplicates an option in
the string, or vice-versa. This is reported when the duplicate is declared,
so may report on either the string or action depending on sequence.
It remains legal to duplicate the same option across multiple actions, with
different meanings. There is no conflict, as the same option can't be passed
to both simultaneously.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>