Eric Blake <address@hidden> wrote:
> $ rm --p
> rm: option `--p' is ambiguous
> Try `rm --help' for more information.
>
> Yet `rm --help' only mentions --preserve-root, since --presume-input-tty
> is intentionally undocumented. Is there a slick way to tell getopt_long
> that a particular option must not be abbreviated, and therefore that it
> cannot be ambiguous with other options that can be abbreviated? It boils
> down to the fact that for all undocumented long options, we don't want to
> be accepting abbreviations or confusing the user with false reports of
> ambiguous options.
Thanks for the prod.
I don't know of a mechanism in getopt_long to do that.
But it is worth changing.
I'll probably just add a leading `-' to the
undocumented (for-testing-only) option name.