-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
52 lines (42 loc) · 917 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"log"
"os"
"github.com/joho/godotenv"
"github.com/spf13/cobra"
)
var (
Server string
SPort string
Host string
HPort string
)
func init() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
startCmd := StartCmd()
// startCmd.Flags().StringVarP(&Server, "server", "s", "", "server-IP for make connection")
// startCmd.Flags().StringVarP(&SPort, "port", "p", "", "server-Port for make connection")
// if err := startCmd.MarkFlagRequired("server"); err != nil {
// fmt.Println(err)
// }
// if err := startCmd.MarkFlagRequired("port"); err != nil {
// fmt.Println(err)
// }
rootCmd.AddCommand(startCmd)
}
func main() {
os.Exit(Run())
//Diff()
}
func StartCmd() *cobra.Command {
return &cobra.Command{
Use: "start",
Short: "start Client Server ",
Run: func(cmd *cobra.Command, args []string) {
DirWatchStart()
},
}
}