Skip to content

sort: an invalid --parallel value is reported by clap, not as GNU does #15183

Closed

Description

@NdekoCode
$ sort --parallel=0 f
error: invalid value '0' for '--parallel <NUM_THREADS>': 0 is not in 1..18446744073709551615
$ sort --parallel=x f
error: invalid value 'x' for '--parallel <NUM_THREADS>': invalid digit found in string
$ sort --parallel=1x f
error: invalid value '1x' for '--parallel <NUM_THREADS>': invalid digit found in string

GNU 9.12 says sort: number in parallel must be nonzero, sort: invalid --parallel argument 'x' (also for -1 and an empty value) and sort: invalid suffix in --parallel argument '1x', with exit status 2, and accepts a leading + (--parallel=+2). uutils main at a5bc606. Part of what sort/sort.pl in #14705 checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions