mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
Merge pull request #142 from anchore/args-fix
cmd: allow no args passed, don't error
This commit is contained in:
commit
691e26d3a3
10
cmd/root.go
10
cmd/root.go
@ -28,8 +28,16 @@ Supports the following image sources:
|
||||
`, map[string]interface{}{
|
||||
"appName": internal.ApplicationName,
|
||||
}),
|
||||
Args: cobra.ExactArgs(1),
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
err := cmd.Help()
|
||||
if err != nil {
|
||||
log.Errorf(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
err := doRunCmd(cmd, args)
|
||||
if err != nil {
|
||||
log.Errorf(err.Error())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user