Skip to content

Commit

Permalink
fix: update usage doc for all oras commands (oras-project#596)
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah authored and Terry Howe committed Feb 2, 2023
1 parent 9708b57 commit e7ce66d
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 20 deletions.
12 changes: 8 additions & 4 deletions cmd/oras/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type attachOptions struct {
func attachCmd() *cobra.Command {
var opts attachOptions
cmd := &cobra.Command{
Use: "attach name<:tag|@digest> [file[:type]...]",
Use: "attach [flags] --artifact-type=<type> <name>{:<tag>|@<digest>} <file>[:<type>] [...]",
Short: "[Preview] Attach files to an existing artifact",
Long: `[Preview] Attach files to an existing artifact
Expand All @@ -53,11 +53,15 @@ func attachCmd() *cobra.Command {
Example - Attach file 'hi.txt' with type 'doc/example' to manifest 'hello:test' in registry 'localhost:5000'
oras attach --artifact-type doc/example localhost:5000/hello:test hi.txt
Example - Attach and update manifest annotations
Example - Attach file 'hi.txt' and add annotations from file 'annotation.json'
oras attach --artifact-type doc/example --annotation-file annotation.json localhost:5000/hello:latest hi.txt
Example - Attach an artifact with manifest annotations
oras attach --artifact-type doc/example --annotation "key1=val1" --annotation "key2=val2" localhost:5000/hello:latest
Example - Attach a file and add manifest annotations
oras attach --artifact-type doc/example --annotation "key=val" localhost:5000/hello:latest hi.txt
Example - Attach and update annotation from manifest annotation file
oras attach --artifact-type doc/example --annotation-file annotation.json localhost:5000/hello:latest hi.txt
`,
Args: cobra.MinimumNArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/blob/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type deleteBlobOptions struct {
func deleteCmd() *cobra.Command {
var opts deleteBlobOptions
cmd := &cobra.Command{
Use: "delete [flags] <name@digest>",
Use: "delete [flags] <name>@<digest>",
Short: "[Preview] Delete a blob from a remote registry",
Long: `[Preview] Delete a blob from a remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/blob/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type fetchBlobOptions struct {
func fetchCmd() *cobra.Command {
var opts fetchBlobOptions
cmd := &cobra.Command{
Use: "fetch [flags] {--output <file>|--descriptor} <name>@<digest>",
Use: "fetch [flags] {--output <file> | --descriptor} <name>@<digest>",
Short: "[Preview] Fetch a blob from a remote registry",
Long: `[Preview] Fetch a blob from a remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/blob/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type pushBlobOptions struct {
func pushCmd() *cobra.Command {
var opts pushBlobOptions
cmd := &cobra.Command{
Use: "push [flags] name[@digest] file",
Use: "push [flags] <name>[@digest] <file>",
Short: "[Preview] Push a blob to a remote registry",
Long: `[Preview] Push a blob to a remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type copyOptions struct {
func copyCmd() *cobra.Command {
var opts copyOptions
cmd := &cobra.Command{
Use: "copy <from-ref> <to-ref>",
Use: "copy [flags] <from>{:<tag>|@<digest>} <to>[:<tag>|@<digest>]",
Aliases: []string{"cp"},
Short: "[Preview] Copy artifacts from one target to another",
Long: `[Preview] Copy artifacts from one target to another
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type discoverOptions struct {
func discoverCmd() *cobra.Command {
var opts discoverOptions
cmd := &cobra.Command{
Use: "discover [options] <name:tag|name@digest>",
Use: "discover [flags] <name>{:<tag>|@<digest>}",
Short: "[Preview] Discover referrers of a manifest in the remote registry",
Long: `[Preview] Discover referrers of a manifest in the remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type loginOptions struct {
func loginCmd() *cobra.Command {
var opts loginOptions
cmd := &cobra.Command{
Use: "login registry",
Use: "login [flags] <registry>",
Short: "Log in to a remote registry",
Long: `Log in to a remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type logoutOptions struct {
func logoutCmd() *cobra.Command {
var opts logoutOptions
cmd := &cobra.Command{
Use: "logout registry",
Use: "logout [flags] <registry>",
Short: "Log out from a remote registry",
Long: `Log out from a remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/manifest/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type deleteOptions struct {
func deleteCmd() *cobra.Command {
var opts deleteOptions
cmd := &cobra.Command{
Use: "delete [flags] name<:tag|@digest>",
Use: "delete [flags] <name>{:<tag>|@<digest>}",
Short: "[Preview] Delete a manifest from remote registry",
Long: `[Preview] Delete a manifest from remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/manifest/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type fetchOptions struct {
func fetchCmd() *cobra.Command {
var opts fetchOptions
cmd := &cobra.Command{
Use: "fetch [flags] <name:tag|name@digest>",
Use: "fetch [flags] <name>{:<tag>|@<digest>}",
Short: "[Preview] Fetch manifest of the target artifact",
Long: `[Preview] Fetch manifest of the target artifact
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/manifest/fetch_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type fetchConfigOptions struct {
func fetchConfigCmd() *cobra.Command {
var opts fetchConfigOptions
cmd := &cobra.Command{
Use: "fetch-config [flag] name<:tag|@digest>",
Use: "fetch-config [flags] <name>{:<tag>|@<digest>}",
Short: "[Preview] Fetch the config of a manifest from a remote registry",
Long: `[Preview] Fetch the config of a manifest from a remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/manifest/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type pushOptions struct {
func pushCmd() *cobra.Command {
var opts pushOptions
cmd := &cobra.Command{
Use: "push [flags] name[:tag|@digest] file",
Use: "push [flags] <name>[:<tag>|@<digest>] <file>",
Short: "[Preview] Push a manifest to remote registry",
Long: `[Preview] Push a manifest to remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type pullOptions struct {
func pullCmd() *cobra.Command {
var opts pullOptions
cmd := &cobra.Command{
Use: "pull <name:tag|name@digest>",
Use: "pull [flags] <name>{:<tag>|@<digest>}",
Short: "Pull files from remote registry",
Long: `Pull files from remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type pushOptions struct {
func pushCmd() *cobra.Command {
var opts pushOptions
cmd := &cobra.Command{
Use: "push name[:tag|@digest] file[:type] [file...]",
Use: "push [flags] <name>[:<tag>|@<digest>] <file>[:<type>] [...]",
Short: "Push files to remote registry",
Long: `Push files to remote registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/repository/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type repositoryOptions struct {
func listCmd() *cobra.Command {
var opts repositoryOptions
cmd := &cobra.Command{
Use: "list [flags] REGISTRY",
Use: "list [flags] <registry>",
Short: "[Preview] List the repositories under the registry",
Long: `[Preview] List the repositories under the registry
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/repository/show-tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type showTagsOptions struct {
func showTagsCmd() *cobra.Command {
var opts showTagsOptions
cmd := &cobra.Command{
Use: "show-tags [flags] REPOSITORY",
Use: "show-tags [flags] <name>",
Short: "[Preview] Show tags of the target repository",
Long: `[Preview] Show tags of the target repository
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/tag/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type tagOptions struct {
func TagCmd() *cobra.Command {
var opts tagOptions
cmd := &cobra.Command{
Use: "tag [flags] name<:tag|@digest> <new_tag...>",
Use: "tag [flags] <name>{:<tag>|@<digest>} <new_tag> [...]",
Short: "[Preview] tag a manifest in the remote registry",
Long: `[Preview] tag a manifest in the remote registry
Expand Down

0 comments on commit e7ce66d

Please sign in to comment.