Skip to content

Commit

Permalink
Add CLI command for visor version output
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Jan 29, 2020
1 parent 9014c82 commit f49ec5b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cmd/skywire-cli/commands/node/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package node

import (
"os"

"github.com/spf13/cobra"
)

func init() {
RootCmd.AddCommand(buildInfoCmd)
}

var buildInfoCmd = &cobra.Command{
Use: "version",
Short: "Obtains version and build info of the node",
Run: func(_ *cobra.Command, _ []string) {
client := rpcClient()
summary, err := client.Summary()
if err != nil {
log.Fatal("Failed to connect:", err)
}

if _, err := summary.BuildInfo.WriteTo(os.Stdout); err != nil {
log.Fatal("Failed to output build info:", err)
}
},
}

0 comments on commit f49ec5b

Please sign in to comment.