Skip to content

Commit

Permalink
nit: update param order
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Apr 6, 2023
1 parent f965cd6 commit 153275d
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cmd/oras/root/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Example - Attach file to the manifest tagged 'v1' in an OCI layout folder 'layou
return cmd
}

func runAttach(opts attachOptions, cmd *cobra.Command) error {
func runAttach(cmd *cobra.Command, opts attachOptions) error {
ctx, _ := opts.WithContext(cmd.Context())
annotations, err := opts.LoadManifestAnnotations()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/blob/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Example - Delete a blob and print its descriptor:
return cmd
}

func deleteBlob(opts deleteBlobOptions, cmd *cobra.Command) (err error) {
func deleteBlob(cmd *cobra.Command, opts deleteBlobOptions) (err error) {
ctx, _ := opts.WithContext(cmd.Context())
repo, err := opts.NewRepository(opts.targetRef, opts.Common)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/blob/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Example - Fetch and print a blob from OCI image layout archive file 'layout.tar'
return cmd
}

func fetchBlob(opts fetchBlobOptions, cmd *cobra.Command) (fetchErr error) {
func fetchBlob(cmd *cobra.Command, opts fetchBlobOptions) (fetchErr error) {
ctx, _ := opts.WithContext(cmd.Context())
var target oras.ReadOnlyTarget
target, err := opts.NewReadonlyTarget(ctx, opts.Common)
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/blob/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Example - Push blob 'hi.txt' into an OCI layout folder 'layout-dir':
return cmd
}

func pushBlob(opts pushBlobOptions, cmd *cobra.Command) (err error) {
func pushBlob(cmd *cobra.Command, opts pushBlobOptions) (err error) {
ctx, _ := opts.WithContext(cmd.Context())

repo, err := opts.NewTarget(opts.Common)
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Example - Copy an artifact with multiple tags with concurrency tuned:
return cmd
}

func runCopy(opts copyOptions, cmd *cobra.Command) error {
func runCopy(cmd *cobra.Command, opts copyOptions) error {
ctx, _ := opts.WithContext(cmd.Context())

// Prepare source
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Example - Discover referrers of the manifest tagged 'v1' in an OCI layout folder
return cmd
}

func runDiscover(opts discoverOptions, cmd *cobra.Command) error {
func runDiscover(cmd *cobra.Command, opts discoverOptions) error {
ctx, _ := opts.WithContext(cmd.Context())
repo, err := opts.NewReadonlyTarget(ctx, opts.Common)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Example - Log in with username and password in an interactive terminal and no TL
return cmd
}

func runLogin(opts loginOptions, cmd *cobra.Command) (err error) {
func runLogin(cmd *cobra.Command, opts loginOptions) (err error) {
ctx, _ := opts.WithContext(cmd.Context())

// prompt for credential
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Example - Logout:
return cmd
}

func runLogout(opts logoutOptions, cmd *cobra.Command) error {
func runLogout(cmd *cobra.Command, opts logoutOptions) error {
if opts.debug {
logrus.SetLevel(logrus.DebugLevel)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/manifest/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Example - Delete a manifest by digest 'sha256:99e4703fbf30916f549cd6bfa9cdbab614
return cmd
}

func deleteManifest(opts deleteOptions, cmd *cobra.Command) error {
func deleteManifest(cmd *cobra.Command, opts deleteOptions) error {
ctx, _ := opts.WithContext(cmd.Context())
repo, err := opts.NewRepository(opts.targetRef, opts.Common)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/manifest/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Example - Fetch raw manifest from an OCI layout archive file 'layout.tar':
return cmd
}

func fetchManifest(opts fetchOptions, cmd *cobra.Command) (fetchErr error) {
func fetchManifest(cmd *cobra.Command, opts fetchOptions) (fetchErr error) {
ctx, _ := opts.WithContext(cmd.Context())

target, err := opts.NewReadonlyTarget(ctx, opts.Common)
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/manifest/fetch_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Example - Fetch and print the prettified descriptor of the config:
return cmd
}

func fetchConfig(opts fetchConfigOptions, cmd *cobra.Command) (fetchErr error) {
func fetchConfig(cmd *cobra.Command, opts fetchConfigOptions) (fetchErr error) {
ctx, _ := opts.WithContext(cmd.Context())

repo, err := opts.NewReadonlyTarget(ctx, opts.Common)
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/manifest/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Example - Push a manifest to an OCI layout folder 'layout-dir' and tag with 'v1'
return cmd
}

func pushManifest(opts pushOptions, cmd *cobra.Command) error {
func pushManifest(cmd *cobra.Command, opts pushOptions) error {
ctx, _ := opts.WithContext(cmd.Context())
var target oras.Target
var err error
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Example - Pull artifact files from an OCI layout archive 'layout.tar':
return cmd
}

func runPull(opts pullOptions, cmd *cobra.Command) error {
func runPull(cmd *cobra.Command, opts pullOptions) error {
ctx, _ := opts.WithContext(cmd.Context())
// Copy Options
var printed sync.Map
Expand Down
4 changes: 2 additions & 2 deletions cmd/oras/root/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Example - Push file "hi.txt" into an OCI layout folder 'layout-dir' with tag 'te
return cmd
}

func runPush(opts pushOptions, cmd *cobra.Command) error {
func runPush(cmd *cobra.Command, opts pushOptions) error {
ctx, _ := opts.WithContext(cmd.Context())
annotations, err := opts.LoadManifestAnnotations()
if err != nil {
Expand Down Expand Up @@ -213,7 +213,7 @@ func runPush(opts pushOptions, cmd *cobra.Command) error {
return opts.ExportManifest(ctx, store, root)
}

func updateDisplayOption(opts *oras.CopyGraphOptions, store content.Fetcher, verbose bool) {
func updateDisplayOption(cmd *cobra.Command, *oras.CopyGraphOptions, store content.Fetcher, verbose bool) {
committed := &sync.Map{}
opts.PreCopy = display.StatusPrinter("Uploading", verbose)
opts.OnCopySkipped = func(ctx context.Context, desc ocispec.Descriptor) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/repo/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Example - List the repositories under the registry that include values lexically
return cmd
}

func listRepository(opts repositoryOptions, cmd *cobra.Command) error {
func listRepository(cmd *cobra.Command, opts repositoryOptions) error {
ctx, _ := opts.WithContext(cmd.Context())
reg, err := opts.Remote.NewRegistry(opts.hostname, opts.Common)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/repo/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Example - Show tags associated with a digest:
return cmd
}

func showTags(opts showTagsOptions, cmd *cobra.Command) error {
func showTags(cmd *cobra.Command, opts showTagsOptions) error {
ctx, logger := opts.WithContext(cmd.Context())
finder, err := opts.NewReadonlyTarget(ctx, opts.Common)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/root/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Example - Tag the manifest 'v1.0.1' to 'v1.0.2' in an OCI layout folder 'layout-
return cmd
}

func tagManifest(opts tagOptions, cmd *cobra.Command) error {
func tagManifest(cmd *cobra.Command, opts tagOptions) error {
ctx, _ := opts.WithContext(cmd.Context())
target, err := opts.NewTarget(opts.Common)
if err != nil {
Expand Down

0 comments on commit 153275d

Please sign in to comment.