equal
deleted
inserted
replaced
|
1 // Copyright © 2017 Mikael Berthe <mikael@lilotux.net> |
|
2 // |
|
3 // Licensed under the MIT license. |
|
4 // Please see the LICENSE file is this directory. |
|
5 |
|
6 package cmd |
|
7 |
|
8 import ( |
|
9 "github.com/spf13/cobra" |
|
10 ) |
|
11 |
|
12 // timelinesCmd represents the timelines command |
|
13 var instanceCmd = &cobra.Command{ |
|
14 Use: "instance", |
|
15 Short: "Display current instance information", |
|
16 RunE: instanceRunE, |
|
17 } |
|
18 |
|
19 func init() { |
|
20 RootCmd.AddCommand(instanceCmd) |
|
21 } |
|
22 |
|
23 func instanceRunE(cmd *cobra.Command, args []string) error { |
|
24 if err := madonInit(false); err != nil { |
|
25 return err |
|
26 } |
|
27 |
|
28 i, err := gClient.GetCurrentInstance() |
|
29 if err != nil { |
|
30 errPrint("Error: %s", err.Error()) |
|
31 return nil |
|
32 } |
|
33 |
|
34 p, err := getPrinter() |
|
35 if err != nil { |
|
36 return err |
|
37 } |
|
38 return p.PrintObj(i, nil, "") |
|
39 } |