cmd

package
v0.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnsuccessExitCode = 1
)

Variables

View Source
var BuildDate = "unknown"

BuildDate is the date the binary was built.

View Source
var CommitHash = "unknown"

CommitHash is the git commit hash.

View Source
var Version = "dev"

Version is the current version of the CLI.

Functions

func Execute

func Execute()

Execute runs the root command and exits the process with a non-zero status code if an error occurs.

func ExtractHostFromURL added in v0.2.0

func ExtractHostFromURL(rawURL string) (string, error)

ExtractHostFromURL parses the provided URL string and returns the host without scheme.

func GetJFrogCredentials added in v0.2.0

func GetJFrogCredentials(jfrogURL string, flags *MirrorFlags, v *viper.Viper) (string, string, error)

GetJFrogCredentials retrieves JFrog credentials from flags, environment variables, or .netrc.

func NewMirrorCmd added in v0.0.3

func NewMirrorCmd() *cobra.Command

NewMirrorCmd creates a new mirror command.

func NewRootCmd added in v0.0.3

func NewRootCmd() *cobra.Command

NewRootCmd creates the root command for the CLI.

func NewVersionCmd added in v0.1.1

func NewVersionCmd() *cobra.Command

NewVersionCmd creates the version command for the CLI.

func ValidateAndGetConfig added in v0.1.0

func ValidateAndGetConfig(flags *MirrorFlags) (*config.Config, error)

ValidateAndGetConfig is a legacy function for test compatibility. It's a wrapper around buildConfigFromFlags.

Types

type MirrorFlags added in v0.0.3

type MirrorFlags struct {
	ConfigFile      string
	Source          string
	Destination     string
	FromFile        string
	Raw             bool
	Properties      []string
	Unzip           bool
	PreserveZipName bool
	DryRun          bool
	DryRunMode      string
	SourcePathStrip string
	Checksum        string

	// Legacy JFrog-specific flags (backward compatibility, will be removed in future versions)
	JFrogURL               string
	JFrogUser              string
	JFrogPassword          string
	JFrogPasswordFromStdin bool

	// New generic registry flags (preferred for new usage)
	RegistryType              string
	RegistryURL               string
	RegistryUser              string
	RegistryPassword          string
	RegistryPasswordFromStdin bool

	TestMirror *mirror.DefaultMirror // Used for testing only
}

MirrorFlags holds the command-line flags for the mirror command.

func (*MirrorFlags) RunE added in v0.2.0

func (f *MirrorFlags) RunE(cmd *cobra.Command, args []string) error

RunE is a compatibility method for tests.

func (*MirrorFlags) ValidateDryRunMode added in v0.2.0

func (f *MirrorFlags) ValidateDryRunMode() error

ValidateDryRunMode checks if the dry run mode is valid. This method is added for test compatibility.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL