mirror of
https://github.com/restic/restic.git
synced 2026-10-08 11:27:12 +00:00
manpage: Do not panic when no command is given
This commit is contained in:
1 parent
6724b9a583
commit
e348b3deeb
1 file changed
+4
-1
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user