Skip to content

invalid --distribution-spec flag returns wrong error information #897

@qweeah

Description

@qweeah

What happened in your environment?

If an invalid distribution flag is specified by --distribution-spec, the returned error message will imply wrong image specification.

$ oras attach --artifact-type oras.test localhost:5000/command/images:foobar --distribution-spec "???"
Error: unknown image specification flag: "???"

What did you expect to happen?

The returned error message should imply wrong distribution specification.

$ oras attach --artifact-type oras.test localhost:5000/command/images:foobar --distribution-spec "???"
Error: unknown distribution specification flag: "???"

How can we reproduce it?

Use an invalid distribution flag on a command that supports tuning distribution specification.

What is the version of your ORAS CLI?

1.0.0

What is your OS environment?

20.04

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersuxUser experience related

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions