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
Uh oh!
There was an error while loading. Please reload this page.
-
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
lscommand's--format=<format>and-Aaoptions.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=verticalIn the above cases I would need a
short-onlyoption for the-xflag that acts as aselectionand stores a per-determined value into aformatvariable.Similarly, I need to support the equivalent of
ls's-aand -Awhere either flag stores a pre-determined value into analwaysvariable, this variable will default to something likeNever, but will be set toAlwaysshould the-aflag be specified, or be set toAlmostAlwaysshould the-Aflag be specified. Subsequently, passing-aAaAaAshou.ld toggle thealwaysvariable for each occurrence of either flag, with the final-Asetting thealwaysvariable toAlmostAlways.I was thinking I be able to implement both of these using an Action, assuming I can set these up as
short-onlyflags.Beta Was this translation helpful? Give feedback.
All reactions