From 79707eb12fddebb4efee66e00b0ad210edc3a8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Fri, 14 Aug 2026 10:37:29 +0200 Subject: [PATCH 1/2] cmd/microcloud: Hide the --state-dir flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It used used by the snaps 'microcloud' wrapper command but never by the user directly. Signed-off-by: Julian Pelizäus --- cmd/microcloud/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/microcloud/main.go b/cmd/microcloud/main.go index 379e15a20..89bc7e2dd 100644 --- a/cmd/microcloud/main.go +++ b/cmd/microcloud/main.go @@ -62,6 +62,14 @@ func main() { app.SetVersionTemplate("{{.Version}}\n") + // Don't display the --state-dir flag in the help output. + // It is used by the snaps "microcloud" wrapper command but never by the user directly. + err = app.PersistentFlags().MarkHidden("state-dir") + if err != nil { + fmt.Fprintf(os.Stderr, "Cannot hide --state-dir flag: %v\n", err) + os.Exit(1) + } + var cmdInit = cmdInit{common: &commonCmd} app.AddCommand(cmdInit.command()) From 54018673b657399d6982ac6ef2b45e8392cf6236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Fri, 14 Aug 2026 10:52:09 +0200 Subject: [PATCH 2/2] cmd/microcloud: Consistently log errors to stderr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- cmd/microcloud/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/microcloud/main.go b/cmd/microcloud/main.go index 89bc7e2dd..e89cf34ab 100644 --- a/cmd/microcloud/main.go +++ b/cmd/microcloud/main.go @@ -37,7 +37,7 @@ func main() { asker, err := setupAsker(ctx) if err != nil { - fmt.Println(err.Error()) + fmt.Fprintf(os.Stderr, "Failed setting up asker: %v\n", err) os.Exit(1) }