Skip to content

seq: improve error handling for invalid -f values#7032

Merged
sylvestre merged 1 commit intouutils:mainfrom
jfinkels:seq-fmt-errors
Dec 31, 2024
Merged

seq: improve error handling for invalid -f values#7032
sylvestre merged 1 commit intouutils:mainfrom
jfinkels:seq-fmt-errors

Conversation

@jfinkels
Copy link
Copy Markdown
Collaborator

Improve the error message produced by seq when given invalid format specifiers for the -f option. Before this commit:

$ seq -f "%" 1
seq: %: invalid conversion specification
$ seq -f "%g%" 1
seq: %: invalid conversion specification

After this commit:

$ seq -f "%" 1
seq: format '%' ends in %
$ seq -f "%g%" 1
seq: format '%g%' has too many % directives

This matches the behavior of GNU seq.

Improve the error message produced by `seq` when given invalid format
specifiers for the `-f` option. Before this commit:

    $ seq -f "%" 1
    seq: %: invalid conversion specification
    $ seq -f "%g%" 1
    seq: %: invalid conversion specification

After this commit:

    $ seq -f "%" 1
    seq: format '%' ends in %
    $ seq -f "%g%" 1
    seq: format '%g%' has too many % directives

This matches the behavior of GNU `seq`.
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/seq/seq is no longer failing!

@sylvestre sylvestre merged commit ed9e80e into uutils:main Dec 31, 2024
@sylvestre
Copy link
Copy Markdown
Contributor

well done :)

@jfinkels jfinkels deleted the seq-fmt-errors branch January 2, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants