diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-05 10:05:32 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-05 10:05:32 +0200 |
| commit | c83d10b6813d171bf349da71256d719b9148bde4 (patch) | |
| tree | 96ee789f2d434818dcc0408374eb830e26bd48e8 /cli | |
| parent | 93bb4bccdf2b1b201451e0130fbfa90f310dba7b (diff) | |
Add debug variable to save a live fsm graph
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/main.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cli/main.go b/cli/main.go index d0b2165..33fb7d7 100644 --- a/cli/main.go +++ b/cli/main.go @@ -12,8 +12,8 @@ import ( ) func openBrowser(urlString string) { - log.Printf("OAuth: Initialized with AuthURL %s\n", urlString) - log.Println("OAuth: Opening browser with xdg-open...") + fmt.Printf("OAuth: Initialized with AuthURL %s\n", urlString) + fmt.Println("OAuth: Opening browser with xdg-open...") exec.Command("xdg-open", urlString).Start() } @@ -40,8 +40,10 @@ func getGraphviz(fsm *eduvpn.FSM, graph string) string { graph += "bgcolor=\"red\"\n" } if (fsm.Current == name) { + graph += "style=\"bold\"\n" graph += "color=\"blue\"\n" } else { + graph += "style=\"\"\n" graph += "color=\"\"\n" } graph += "label=" + name.String() @@ -66,7 +68,6 @@ func generateGraph() string { } func main() { - generateGraph() fileGraph := flag.String("dumpgraph", "", "Dump the FSM to a graphviz fdp file") urlArg := flag.String("url", "", "The url of the vpn") flag.Parse() @@ -95,7 +96,7 @@ func main() { state := eduvpn.GetVPNState() - state.Register("org.eduvpn.app.linux", "configs", logState) + state.Register("org.eduvpn.app.linux", "configs", logState, true) config, configErr := state.Connect(urlString) if configErr != nil { @@ -103,7 +104,7 @@ func main() { return } - log.Println(config) + fmt.Println(config) return } |
