On Mon, Apr 3, 2023 at 10:59 PM Dominique Martinet
<[email protected]> wrote:
>
> Keith Thompson wrote on Mon, Apr 03, 2023 at 10:15:40PM -0700:
> > The GNU coreutils seq command recognizes and handles negative
> > arguments.
> >
> > The busybox seq command does not. Any argument starting with a '-'
> > character is assumed to be an option name.
> >
> > There is a (rather inconvenient) workaround: you can add a leading
> > space, which is ignored.
>
> You can also use '--' to stop parsing options and feels a bit more
> standard than leading spaces.
[...]

Yes, using "--" is a better workaround than a quoted leading space.

Another minor issue: The usage message for the -w option is unclear
and not entirely accurate:

    -w      Pad to last with leading zeros

It took me a while to figure out that it means that it pads to the width
of the LAST argument.  And in fact it also (correctly) takes into account
the width of the FIRST argument:

    $ busybox seq -s : -w -- -9 1
    -9:-8:-7:-6:-5:-4:-3:-2:-1:00:01
    $ busybox seq -s : -w -- -10 1
    -10:-09:-08:-07:-06:-05:-04:-03:-02:-01:000:001

The GNU coreutils seq command has a clearer usage message for this:

    -w, --equal-width        equalize width by padding with leading zeroes

(I'm not suggesting busybox should support the long option.)
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to