From 6447fa3d0dabcabc5c2061c89c55cbc4dc7512fc Mon Sep 17 00:00:00 2001 From: rika Date: Mon, 11 May 2026 14:47:41 +0000 Subject: [PATCH] docs: fix CLI documentation typos and improve error handling - Fixed spelling errors in 'microcks start' help text and examples - Added an Example usage block to the 'microcks stop' command - Fixed a misspelled error string in localconfig.go ('undifined' -> 'undefined') - Replaced a silent, ignored fmt.Errorf in watcher/executor.go with a proper fmt.Printf error log Signed-off-by: rika --- cmd/start.go | 8 ++++---- cmd/stop.go | 2 ++ pkg/config/localconfig.go | 2 +- pkg/watcher/executor.go | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/start.go b/cmd/start.go index 8044603..4885bab 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -28,10 +28,10 @@ microcks start microcks start --port [Port you want] # Define your driver (by default docker) -microcks start --driver [driver you wnat either 'docker' or 'podman'] +microcks start --driver [driver you want either 'docker' or 'podman'] # Define name of your microcks container/instance -microcks start --name [name of you container/instance]`, +microcks start --name [name of your container/instance]`, Run: func(cmd *cobra.Command, args []string) { configFile := globalClientOpts.ConfigPath @@ -143,10 +143,10 @@ microcks start --name [name of you container/instance]`, fmt.Printf("Microcks started successfully at %s\n", server) }, } - startCmd.Flags().StringVar(&name, "name", "microcks", "name for you microcks instance") + startCmd.Flags().StringVar(&name, "name", "microcks", "name for your microcks instance") startCmd.Flags().StringVar(&hostPort, "port", "8585", "") startCmd.Flags().StringVar(&imageName, "image", "quay.io/microcks/microcks-uber:latest-native", "image which will be used to create a container") - startCmd.Flags().BoolVar(&autoRemove, "rm", false, "mimic of '--rm' flag of dokcer to automatically remove the container when it exits") + startCmd.Flags().BoolVar(&autoRemove, "rm", false, "mimic of '--rm' flag of docker to automatically remove the container when it exits") startCmd.Flags().StringVar(&driver, "driver", "docker", "use --driver to change driver from docker to podman") return startCmd } diff --git a/cmd/stop.go b/cmd/stop.go index eaba91f..cfc9c31 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -16,6 +16,8 @@ func NewStopCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command { Use: "stop", Short: "stop microcks instance", Long: "stop microcks instance", + Example: `# Stop the current Microcks instance +microcks stop`, Run: func(cmd *cobra.Command, args []string) { configFile := globalClientOpts.ConfigPath diff --git a/pkg/config/localconfig.go b/pkg/config/localconfig.go index 1e5eeda..b7e2035 100644 --- a/pkg/config/localconfig.go +++ b/pkg/config/localconfig.go @@ -345,7 +345,7 @@ func (l *LocalConfig) GetAuth(server string) (*Auth, error) { } } - return nil, fmt.Errorf("Auth for '%s' is undifined", server) + return nil, fmt.Errorf("Auth for '%s' is undefined", server) } func (l *LocalConfig) UpsertAuth(auth Auth) { diff --git a/pkg/watcher/executor.go b/pkg/watcher/executor.go index 3347fc6..3689804 100644 --- a/pkg/watcher/executor.go +++ b/pkg/watcher/executor.go @@ -12,7 +12,7 @@ func TriggerImport(entry config.WatchEntry) { // Retrieve config to get client options. cfgPath, err := config.DefaultLocalConfigPath() if err != nil { - fmt.Errorf("Error while loading config: %s", err.Error()) + fmt.Printf("[ERROR] Error while loading config: %s\n", err.Error()) } fmt.Println("[INFO] Re-importing changed file: " + entry.FilePath)