From 9d25d3f6d5a3c1a128dda5a632792e49f4968697 Mon Sep 17 00:00:00 2001 From: DanHam Date: Wed, 22 Mar 2023 12:51:26 +0000 Subject: [PATCH] Fix shell completion by adding missing usage message required by spf13/cobra The spf13/cobra library requires and uses the first command given in the usage to correctly generate the shell completion script. Signed-off-by: DanHam --- cmd/syft/cli/commands.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/syft/cli/commands.go b/cmd/syft/cli/commands.go index cc80b97aa34..39e3ab01257 100644 --- a/cmd/syft/cli/commands.go +++ b/cmd/syft/cli/commands.go @@ -55,6 +55,7 @@ func New() (*cobra.Command, error) { // rootCmd is currently an alias for the packages command rootCmd := &cobra.Command{ + Use: fmt.Sprintf("%s [SOURCE]", internal.ApplicationName), Short: packagesCmd.Short, Long: packagesCmd.Long, Args: packagesCmd.Args,