oras-project/oras

Bad UX of `--oci-layout-path` flag working with `oras repo tags`

Opened this issue · 2 comments

What happened in your environment?

I have an OCI layout that contains several tags, some are in format of FQDN. I can list the tags by running oras repo tags --oci-layout $dirName, for example:

$ oras repo tags --oci-layout ./repo
example.registry.com/foo:latest
test.com/bar:v1
v2

However, if I replace --oci-layout with --oci-layout-path like this, there will be an error:

$ oras repo tags --oci-layout-path ./repo
Error: "oras repo tags" requires exactly 1 argument but got 0
Usage: oras repo tags [flags] <name>
Please specify exactly 1 argument as the target repository to list tags from. Run "oras repo tags -h" for more options and examples

The right way is to add one more parameter as the repository name, which should be an empty string in this case:

oras repo tags --oci-layout-path ./repo ""
example.registry.com/foo:latest
test.com/bar:v1
v2

This UX is strange and not intuitive.

What did you expect to happen?

The --oci-layout=path flag may not be applicable to the oras repo tags command.

How can we reproduce it?

  1. Run oras repo tags --oci-layout $dirName
  2. Run oras repo tags --oci-layout-path $dirName ""

What is the version of your ORAS CLI?

Version: 1.3.0-beta.1
Go version: go1.23.4
OS/Arch: linux/amd64
Git commit: 2ca02f6
Git tree state: clean

What is your OS environment?

Ubuntu 24.04 in WSL

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.
bupd commented

I hope I can help you with this. Should I open a PR?

cc // @Wwwsylvia, @FeynmanZhou

Hi @bupd , thank you showing interest! Before jumping directly to the implementation, you may propose a design here in the issue comment, and the community can discuss it together.