You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--color[=WHEN] colorize the output; WHEN can be 'always' (default
if omitted), 'auto', or 'never'; more info below
You can say:
ls --color=never /tmp ← color has argument "never"
ls --color /tmp ← color has no argument, defaults to "auto"
ls --color never /tmp ← color has no argument, defaults to "auto" and "never" is treated as a positional argument
So the --color option has an optional argument, which it will only consume if it is in the same command-line argument.
With OptionArgumentIterator there is no way distinguish between --color=never and --color never, so it is currently impossible to simulate the behavior of this option.
Suggested fix: add a property to OptionArgumentIterator to indicate whether the first argument is "mandatory". A "storingWithDefault" convenience method could then be created that would consume an argument iff it is mandatory.
The text was updated successfully, but these errors were encountered:
The
--help
for GNUls
looks like:You can say:
ls --color=never /tmp
← color has argument "never"ls --color /tmp
← color has no argument, defaults to "auto"ls --color never /tmp
← color has no argument, defaults to "auto" and "never" is treated as a positional argumentSo the
--color
option has an optional argument, which it will only consume if it is in the same command-line argument.With
OptionArgumentIterator
there is no way distinguish between--color=never
and--color never
, so it is currently impossible to simulate the behavior of this option.Suggested fix: add a property to
OptionArgumentIterator
to indicate whether the first argument is "mandatory". A "storingWithDefault" convenience method could then be created that would consume an argument iff it is mandatory.The text was updated successfully, but these errors were encountered: