From ff62775628ec09d5a5ad2207671f3651c497f3dc Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Fri, 17 Jan 2025 09:36:31 +0100 Subject: [PATCH] cmd: exactly 1 arg Since we only accept one image type (for now) we only need to accept exactly one argument. Signed-off-by: Simon de Vlieger --- cmd/image-builder/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/image-builder/main.go b/cmd/image-builder/main.go index 594bb5d..98485fd 100644 --- a/cmd/image-builder/main.go +++ b/cmd/image-builder/main.go @@ -176,7 +176,7 @@ operating sytsems like centos and RHEL with easy customizations support.`, Short: "Build manifest for the given distro/image-type, e.g. centos-9 qcow2", RunE: cmdManifest, SilenceUsage: true, - Args: cobra.RangeArgs(1, 2), + Args: cobra.ExactArgs(1), Hidden: true, } manifestCmd.Flags().String("blueprint", "", `blueprint to customize an image`) @@ -192,7 +192,7 @@ operating sytsems like centos and RHEL with easy customizations support.`, Short: "Build the given distro/image-type, e.g. centos-9 qcow2", RunE: cmdBuild, SilenceUsage: true, - Args: cobra.RangeArgs(1, 2), + Args: cobra.ExactArgs(1), } buildCmd.Flags().AddFlagSet(manifestCmd.Flags()) // XXX: add --rpmmd cache too and put under /var/cache/image-builder/dnf