Skip to content

Commit 155498a

Browse files
authored
Make configPath a command-line flag in desktop_bin
1 parent a2f62a6 commit 155498a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

desktop_bin/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"flag"
45
"fmt"
56
"os"
67
"os/signal"
@@ -12,8 +13,8 @@ import (
1213
)
1314

1415
func main() {
15-
configPath := os.Args[1]
16-
fmt.Println("configPath:", configPath)
16+
configPath := flag.String("configPath", "config.json", "Path of config.json")
17+
flag.Parse()
1718
err := runXray(configPath)
1819
if err != nil {
1920
os.Exit(1)

0 commit comments

Comments
 (0)