Skip to content

xargs: support -i option without an equals sign before the argument #594

@brian-pane

Description

@brian-pane

Some of the failures in the Gnu test suite happen because tests use the idiom xargs -iARG, and the Rust xargs implementation currently requires an equals sign after the -i.

As a simple example,

echo "123" | xargs -iARG echo ARG
123
echo "123" | ./target/release/xargs -iARG echo ARG
Error: error: unexpected argument '-A' found

  tip: to pass '-A' as a value, use '-- -A'

Usage: xargs [OPTIONS] [COMMAND]...

For more information, try '--help'.

For compatibility, I think the command line parser should support the use of -i without the =.

I'm willing to work on a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions