INNER CODE UNIT · Go

NewRootCommand

nicholas-fedor/watchtower · cmd/root.go:138

func NewRootCommand() *cobra.Command {
	return &cobra.Command{
		Use:   "watchtower",
		Short: "Automatically updates running Docker containers",
		Long:  "\nWatchtower automatically updates running Docker containers whenever a new image is released.\nMore information available at https://github.com/nicholas-fedor/watchtower/.",
		Args:  cobra.ArbitraryArgs, // Permits any number of positional arguments, processed as container names later.
	}
}

// Execute runs the root command and manages any errors encountered during its execution.
//
// It serves as the primary entry point for the Watchtower CLI, called from main.go, and ensures that any
// fatal errors are logged and terminate the program with an appropriate exit status, providing a clean
// interface between the CLI and the operating system.
//
// Parameters:
//   - log: Process logger from main (reconfigured in preRun from --log-format / --log-level).
func Execute(log *zerolog.Logger) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…