mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-08-27 14:07:17 +00:00
fix: silencing usage on failures
This commit is contained in:
@@ -30,7 +30,7 @@ func NewCopyCommand() *cobra.Command {
|
||||
|
||||
f := cmd.Flags()
|
||||
f.StringVarP(&opts.dir, "dir", "d", ".", "Target directory for file copy")
|
||||
f.StringVarP(&opts.src, "registry", "r", "myregistry:5000", "Registry URL to copy file from")
|
||||
f.StringVarP(&opts.src, "registry", "r", "localhost:5000/file:test", "URI for object in the registry")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ var (
|
||||
haulerctl bundle artifacts <artfiacts>
|
||||
haulerctl relocate artifacts <aritfacts>
|
||||
haulerctl relocate images <images>
|
||||
haulerctl copy <registry>
|
||||
haulerctl copy
|
||||
haulerctl create
|
||||
haulerctl bootstrap`
|
||||
)
|
||||
@@ -38,10 +38,11 @@ var (
|
||||
// NewRootCommand defines the root haulerctl command
|
||||
func NewRootCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "haulerctl",
|
||||
Short: "haulerctl provides CLI-based air-gap migration assistance",
|
||||
Long: getLong,
|
||||
Example: getExample,
|
||||
Use: "haulerctl",
|
||||
Short: "haulerctl provides CLI-based air-gap migration assistance",
|
||||
Long: getLong,
|
||||
Example: getExample,
|
||||
SilenceUsage: true,
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
if err := setupLogger(os.Stdout, loglevel); err != nil {
|
||||
return err
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ func (c Copier) Get(ctx context.Context, src string) error {
|
||||
resolver := docker.NewResolver(docker.ResolverOptions{})
|
||||
|
||||
// Pull file(s) from registry and save to disk
|
||||
fmt.Printf("Pulling from %s and saving to %s...\n", src, c.Dir)
|
||||
fmt.Printf("Pulling from %s and saving to %s\n", src, c.Dir)
|
||||
allowedMediaTypes := []string{(c.mediaType)}
|
||||
desc, _, err := oras.Pull(ctx, resolver, src, c.fileStore, oras.WithAllowedMediaTypes(allowedMediaTypes))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user