diff --git a/rget/cmd/server.go b/rget/cmd/server.go index 2cd4262..3c3b808 100644 --- a/rget/cmd/server.go +++ b/rget/cmd/server.go @@ -128,6 +128,10 @@ func (r sumRepo) handler(resp http.ResponseWriter, req *http.Request) { } func server(cmd *cobra.Command, args []string) { + if len(args) < 2 { + fmt.Printf("missing required arguments (public git URL, private git URL)\n") + os.Exit(1) + } pubgit := args[0] privgit := args[1] @@ -161,7 +165,7 @@ func server(cmd *cobra.Command, args []string) { } if !strings.HasSuffix(host, "."+rgetwellknown.PublicServiceHost) { - return nil, errors.New(fmt.Sprintf("not in TLD %v", rgetwellknown.PublicServiceHost)) + return nil, fmt.Errorf("not in TLD %v", rgetwellknown.PublicServiceHost) } key := strings.TrimSuffix(host, "."+rgetwellknown.PublicServiceHost)