func showVersion(ctx *cli.Context) { argCheck(0, ctx) ver := version.Info{} if err := getObject(ctx, versionURL(ctx), &ver); err != nil { fmt.Printf("Unable to fetch version information") } else { fmt.Printf("Client Version:\n") fmt.Printf(version.String()) fmt.Printf("\n") fmt.Printf("Server Version:\n") fmt.Printf(version.StringFromInfo(&ver)) } }
func showVersion(ctx *cli.Context) { if len(ctx.Args()) != 0 { errExit(ctx, exitHelp, "More arguments than required", true) } ver := version.Info{} if err := getObject(ctx, versionURL(ctx), &ver); err != nil { fmt.Printf("Unable to fetch version information\n") } else { fmt.Printf("Client Version:\n") fmt.Printf(version.String()) fmt.Printf("\n") fmt.Printf("Server Version:\n") fmt.Printf(version.StringFromInfo(&ver)) } }