From 097c7a9e55a72dc744cf852352df520163b1bc88 Mon Sep 17 00:00:00 2001 From: Peter Krnjevic Date: Tue, 7 Jun 2016 14:36:33 -0400 Subject: [PATCH] Move from codegangsta to urfave/cli; fix for cli.Action deprecation --- main.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 54f572a..a90a2ba 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ package main import ( "errors" "fmt" - "github.com/codegangsta/cli" + "github.com/urfave/cli" "github.com/meshbird/meshbird/common" "github.com/meshbird/meshbird/log" "github.com/meshbird/meshbird/secure" @@ -81,7 +81,7 @@ func main() { } } -func actionGetIP(ctx *cli.Context) { +func actionGetIP(ctx *cli.Context) error { if NetworkKey == "" { log.Fatal(keyNotSetError.Error()) } @@ -96,9 +96,10 @@ func actionGetIP(ctx *cli.Context) { fmt.Println(state.PrivateIP.String()) log.Info("private IP %q restored successfully", state.PrivateIP.String()) + return err } -func actionNew(ctx *cli.Context) { +func actionNew(ctx *cli.Context) error { var secret *secure.NetworkSecret var err error @@ -116,9 +117,10 @@ func actionNew(ctx *cli.Context) { secret = secure.NewNetworkSecret(ipNet) } fmt.Println(secret.Marshal()) + return err } -func actionJoin(ctx *cli.Context) { +func actionJoin(ctx *cli.Context) error { if NetworkKey == "" { log.Fatal(keyNotSetError.Error()) } @@ -147,4 +149,5 @@ func actionJoin(ctx *cli.Context) { } node.WaitStop() + return err }