mirror of
https://github.com/containers/skopeo.git
synced 2025-09-10 11:09:47 +00:00
Merge pull request #520 from mtrmac/copy-error-handling
Ensure that we still return 1, and print something to stderr, on (skopeo copy) failure
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -33,7 +34,8 @@ func contextsFromGlobalOptions(c *cli.Context) (*types.SystemContext, *types.Sys
|
|||||||
|
|
||||||
func copyHandler(c *cli.Context) error {
|
func copyHandler(c *cli.Context) error {
|
||||||
if len(c.Args()) != 2 {
|
if len(c.Args()) != 2 {
|
||||||
return cli.ShowCommandHelp(c, "copy")
|
cli.ShowCommandHelp(c, "copy")
|
||||||
|
return errors.New("Exactly two arguments expected")
|
||||||
}
|
}
|
||||||
|
|
||||||
policyContext, err := getPolicyContext(c)
|
policyContext, err := getPolicyContext(c)
|
||||||
|
Reference in New Issue
Block a user