Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use short names for repository commands #670

Merged
merged 4 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/oras/repository/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (

func Cmd() *cobra.Command {
cmd := &cobra.Command{
Use: "repository [command]",
Use: "repo [command]",
Short: "[Preview] Repository operations",
Aliases: []string{"repo"},
Aliases: []string{"repository"},
}

cmd.AddCommand(
Expand Down
8 changes: 4 additions & 4 deletions cmd/oras/repository/list.go → cmd/oras/repository/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ type repositoryOptions struct {
func listCmd() *cobra.Command {
var opts repositoryOptions
cmd := &cobra.Command{
Use: "list [flags] <registry>",
Use: "ls [flags] <registry>",
Short: "[Preview] List the repositories under the registry",
Long: `[Preview] List the repositories under the registry

** This command is in preview and under development. **

Example - List the repositories under the registry:
oras repository list localhost:5000
oras repo ls localhost:5000

Example - List the repositories under the registry that include values lexically after last:
oras repository list --last "last_repo" localhost:5000
oras repo ls --last "last_repo" localhost:5000
`,
Args: cobra.ExactArgs(1),
Aliases: []string{"ls"},
Aliases: []string{"list"},
RunE: func(cmd *cobra.Command, args []string) error {
opts.hostname = args[0]
return listRepository(opts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ type showTagsOptions struct {
func showTagsCmd() *cobra.Command {
var opts showTagsOptions
cmd := &cobra.Command{
Use: "show-tags [flags] <name>",
Use: "tags [flags] <name>",
Short: "[Preview] Show tags of the target repository",
Long: `[Preview] Show tags of the target repository

** This command is in preview and under development. **

Example - Show tags of the target repository:
oras repository show-tags localhost:5000/hello
oras repo tags localhost:5000/hello

Example - Show tags in the target repository with digest-like tags hidden:
oras repository show-tags --exclude-digest-tag localhost:5000/hello
oras repo tags --exclude-digest-tag localhost:5000/hello

Example - Show tags of the target repository that include values lexically after last:
oras repository show-tags --last "last_tag" localhost:5000/hello
oras repo tags --last "last_tag" localhost:5000/hello
`,
Args: cobra.ExactArgs(1),
Aliases: []string{"tags"},
Aliases: []string{"show-tags"},
RunE: func(cmd *cobra.Command, args []string) error {
opts.targetRef = args[0]
return showTags(opts)
Expand Down