Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootc-image-builder/main: improve command line help #762

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions bib/cmd/bootc-image-builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,25 +554,30 @@ 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,
}

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,
Expand Down
Loading