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
I have a situation which effectively requires short-only options and wondering if/how that can be implemented.
As an example GNU/POSIX use case, I need the same/similar functionality as is found with the GNU ls command's --format=<format> and -Aa options.
E.g. ls --format=<across|commas|horizontal|long|single-column|verbose|vertical>
The format can also be selected via:
-x = --format=across
-m = --format=commas
-x = --format=horizontal
-l = --format=long
-1 = --format=single-column
-l = --format=verbose
-C = --format=vertical
In the above cases I would need a short-only option for the -x flag that acts as a selection and stores a per-determined value into a format variable.
Similarly, I need to support the equivalent of ls's -a and -A where either flag stores a pre-determined value into an always variable, this variable will default to something like Never, but will be set to Always should the -a flag be specified, or be set to AlmostAlways should the -A flag be specified. Subsequently, passing -aAaAaA shou.ld toggle the always variable for each occurrence of either flag, with the final -A setting the always variable to AlmostAlways.
I was thinking I be able to implement both of these using an Action, assuming I can set these up as short-only flags.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a situation which effectively requires short-only options and wondering if/how that can be implemented.
As an example GNU/POSIX use case, I need the same/similar functionality as is found with the GNU
ls
command's--format=<format>
and-Aa
options.E.g.
ls --format=<across|commas|horizontal|long|single-column|verbose|vertical>
The format can also be selected via:
-x
=--format=across
-m
=--format=commas
-x
=--format=horizontal
-l
=--format=long
-1
=--format=single-column
-l
=--format=verbose
-C
=--format=vertical
In the above cases I would need a
short-only
option for the-x
flag that acts as aselection
and stores a per-determined value into aformat
variable.Similarly, I need to support the equivalent of
ls
's-a
and -A
where either flag stores a pre-determined value into analways
variable, this variable will default to something likeNever
, but will be set toAlways
should the-a
flag be specified, or be set toAlmostAlways
should the-A
flag be specified. Subsequently, passing-aAaAaA
shou.ld toggle thealways
variable for each occurrence of either flag, with the final-A
setting thealways
variable toAlmostAlways
.I was thinking I be able to implement both of these using an Action, assuming I can set these up as
short-only
flags.Beta Was this translation helpful? Give feedback.
All reactions