2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-30 07:30:50 +00:00

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

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)
}