On Tue, Apr 11, 2023 at 11:31 AM Denys Vlasenko
<[email protected]> wrote:
>
> On Mon, Apr 10, 2023 at 6:34 PM Keith Thompson
> <[email protected]> wrote:
> > On Mon, Apr 10, 2023 at 5:35 AM Denys Vlasenko <[email protected]> 
> > wrote:
> > > On Tue, Apr 4, 2023 at 7:16 AM Keith Thompson
> > > <[email protected]> wrote:
> > > > 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.
> > >
> > >
> > > Fixed, please try current git.
> >
> > I just tried it (commit 200a9669f), and there's still a bug.
> >
> > If you use "-s" with an argument *and* a negative number, it prints a
> > usage message.
> > $ busybox seq -s : -1 1
> > seq: invalid option -- '1'
>
> Fixed this too, please try current git.

The current version (commit 478b5ac2b, 2023-04-11) correctly handles
all the test cases from my previous email.

I see from the comments that it can still break on "-s -1" (it hadn't
even occurred to me that the separator can be more than one character),
but that's probably not worth worrying about. Other separators starting
with "-" do work, including "-s --".

    $ busybox seq -s - -1 1
    -1-0-1
    $ busybox seq -s -- -1 1
    -1--0--1
    $ seq -s -1 -1 1
    seq: option requires an argument -- 's'
    [snip]

I have some vague thoughts about ways to handle the arguments that
correctly handle a few more corner cases, but I'm not going to worry
about it too much.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to