Skip to content

tr: -d a b c should show similar error as -d a b #5950

@cakebaker

Description

@cakebaker

This issue was mentioned by @BaherSalama in #5945.

GNU tr shows almost the same error for tr -d a b and tr -d a b c:

$ tr -d a b
tr: extra operand ‘b’
Only one string may be given when deleting without squeezing repeats.
Try 'tr --help' for more information.
$ tr -d a b c
tr: extra operand ‘b’
Try 'tr --help' for more information.

uutils tr, on the other hand, shows a clap error in the second case:

$ cargo run tr -d a b
tr: extra operand 'b'
Only one string may be given when deleting without squeezing repeats.
Try 'target/debug/coreutils tr --help' for more information.
$ cargo run tr -d a b c
error: unexpected value 'c' for '[sets]...' found; no more were expected

Usage: target/debug/coreutils tr [OPTION]... SET1 [SET2]

For more information, try '--help'.

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