From 48ba71eb3437d80ff75d9dbfd497e016357df442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=BCller?= Date: Wed, 18 Dec 2024 09:34:00 +0100 Subject: [PATCH] bootc-image-builder/main: improve command line help --- bib/cmd/bootc-image-builder/main.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bib/cmd/bootc-image-builder/main.go b/bib/cmd/bootc-image-builder/main.go index a49afed3b..184418124 100644 --- a/bib/cmd/bootc-image-builder/main.go +++ b/bib/cmd/bootc-image-builder/main.go @@ -554,7 +554,7 @@ func cmdVersion(_ *cobra.Command, _ []string) error { func buildCobraCmdline() (*cobra.Command, error) { rootCmd := &cobra.Command{ Use: "bootc-image-builder", - Long: "create a bootable image from an ostree native container", + Long: "Create a bootable image from an ostree native container", PersistentPreRunE: rootPreRunE, SilenceErrors: true, } @@ -562,17 +562,22 @@ func buildCobraCmdline() (*cobra.Command, error) { rootCmd.PersistentFlags().StringVar(&rootLogLevel, "log-level", "", "logging level (debug, info, error); default error") buildCmd := &cobra.Command{ - Use: "build", - Long: rootCmd.Long, + Use: "build IMAGE_NAME", + Short: rootCmd.Long + " (default command)", + Long: rootCmd.Long + "\n" + + "(default action if no command is given)\n" + + "IMAGE_NAME: container image to build into a bootable image", Args: cobra.ExactArgs(1), DisableFlagsInUseLine: true, RunE: cmdBuild, SilenceUsage: true, + Example: rootCmd.Use + " build quay.io/centos-bootc/centos-bootc:stream9\n" + + rootCmd.Use + " quay.io/centos-bootc/centos-bootc:stream9\n", } rootCmd.AddCommand(buildCmd) manifestCmd := &cobra.Command{ Use: "manifest", - Long: rootCmd.Long, + Short: "Only create the manifest but don't build the image.", Args: cobra.ExactArgs(1), DisableFlagsInUseLine: true, RunE: cmdManifest,