diff --git a/main.go b/main.go index c8b43224..f4e676f2 100644 --- a/main.go +++ b/main.go @@ -108,6 +108,10 @@ func main() { Aliases: []string{"rm"}, Usage: "delete a specific reference of a repository", Action: func(c *cli.Context) error { + if len(c.Args()) < 1 { + return fmt.Errorf("pass the name of the repository") + } + repo, ref, err := utils.GetRepoAndRef(c.Args()[0]) if err != nil { return err @@ -173,6 +177,10 @@ func main() { }, }, Action: func(c *cli.Context) error { + if len(c.Args()) < 1 { + return fmt.Errorf("pass the name of the repository") + } + repo, ref, err := utils.GetRepoAndRef(c.Args()[0]) if err != nil { return err @@ -231,6 +239,10 @@ func main() { }, }, Action: func(c *cli.Context) error { + if len(c.Args()) < 1 { + return fmt.Errorf("pass the name of the repository") + } + repo, ref, err := utils.GetRepoAndRef(c.Args()[0]) if err != nil { return err @@ -269,6 +281,9 @@ func main() { if c.String("clair") == "" { return errors.New("clair url cannot be empty, pass --clair") } + if len(c.Args()) < 1 { + return fmt.Errorf("pass the name of the repository") + } repo, ref, err := utils.GetRepoAndRef(c.Args()[0]) if err != nil {