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
The enhancement suggestion is, make string repeat 5 x or echo x | string repeat 5 (which both silently exit status 1 with no error message today) equivalent to string repeat -n 5 x or echo x | string repeat -n 5, taking the first positional argument as COUNT and additional arguments as STRINGs, like how string join takes the first argument as the separator.
>echo x | string repeat 5
xxxxx
> string repeat 5 x
xxxxx
In other words, it should basically behave how you'd expect it to if the usage synopsis had an additional simpler signature:
-n or --count should be required only to distinguish things in the case where a --max is being used, for the sake of things not being ambiguous and it is important that only things that used to error start to work, but things that worked before do not have a change in behavior. This example would needs to have the same output as it does today:
> string repeat 5 x --max 3
555
xxx
i.e. it will still be necessary to explicitly specify a --count option:
> string repeat --count 5 x --max 3
xxx
The motivation here is to make string repeat easier to figure out and remember how to use, taking into consideration --max is a rare thing.
The text was updated successfully, but these errors were encountered:
string repeat
has this usage signature:The enhancement suggestion is, make
string repeat 5 x
orecho x | string repeat 5
(which both silently exit status 1 with no error message today) equivalent tostring repeat -n 5 x
orecho x | string repeat -n 5
, taking the first positional argument as COUNT and additional arguments as STRINGs, like howstring join
takes the first argument as the separator.In other words, it should basically behave how you'd expect it to if the usage synopsis had an additional simpler signature:
-n
or--count
should be required only to distinguish things in the case where a--max
is being used, for the sake of things not being ambiguous and it is important that only things that used to error start to work, but things that worked before do not have a change in behavior. This example would needs to have the same output as it does today:i.e. it will still be necessary to explicitly specify a
--count
option:The motivation here is to make
string repeat
easier to figure out and remember how to use, taking into consideration--max
is a rare thing.The text was updated successfully, but these errors were encountered: