Skip to content

Conflicting options #11

@tertsdiepraam

Description

@tertsdiepraam

It doesn't occur often in coreutils, but sometimes options conflict. They might even conflict with themselves. This is tricky to support while also maintaining good error messages.

One design could be to define conflict groups (leaving out some boilerplate in the example):

enum Arg {
    #[arg("--foo", conflict_group="foobar")]
    Foo,
    #[arg("--bar", conflict_group="foobar")]
    Bar,
}

"foobar" is a key into some hashset of options that have been set.

An example of conflicting options are cut's --fields, --bytes and --characters.

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