diff --git a/main.go b/main.go index 61f9f3f..6e174d6 100644 --- a/main.go +++ b/main.go @@ -15,11 +15,11 @@ var template []byte func main() { root := &cobra.Command{}; servecmd := &cobra.Command{ - Use: "serve", + Use: "download", Short: "server to listen for competitive companion requests", Run: func(cmd *cobra.Command, args []string) { port, _ := cmd.Flags().GetInt("port"); - fmt.Println("Listning on port", port, "...") + fmt.Println("Listening on port", port, "...") server(port); }, } diff --git a/server.go b/server.go index 7571904..17c030b 100644 --- a/server.go +++ b/server.go @@ -32,6 +32,7 @@ func server(port int) { os.WriteFile(path.Join("cpgo_tests", fmt.Sprint(idx+1) + ".input"), input, 0644); os.WriteFile(path.Join("cpgo_tests", fmt.Sprint(idx+1) + ".output"), output, 0644); } + os.Exit(0); }) http.ListenAndServe(fmt.Sprintf("127.0.0.1:%v", port), nil); }