manpage: Do not panic when no command is given

This commit is contained in:
Alexander Neumann 2017-08-06 21:01:49 +02:00
parent 6724b9a583
commit e348b3deeb
1 changed files with 4 additions and 1 deletions

View File

@ -42,7 +42,10 @@ func runManpage(cmd *cobra.Command, args []string) error {
return doc.GenManTree(cmdRoot, header, dir)
}
if len(args) > 1 {
switch {
case len(args) == 0:
return errors.Fatalf("no command given")
case len(args) > 1:
return errors.Fatalf("more than one command given: %v", args)
}