(args []string)
| 49 | } |
| 50 | |
| 51 | func (c *OperatorKeyStatusCommand) Run(args []string) int { |
| 52 | f := c.Flags() |
| 53 | |
| 54 | if err := f.Parse(args); err != nil { |
| 55 | c.UI.Error(err.Error()) |
| 56 | return 1 |
| 57 | } |
| 58 | |
| 59 | args = f.Args() |
| 60 | if len(args) > 0 { |
| 61 | c.UI.Error(fmt.Sprintf("Too many arguments (expected 0, got %d)", len(args))) |
| 62 | return 1 |
| 63 | } |
| 64 | |
| 65 | client, err := c.Client() |
| 66 | if err != nil { |
| 67 | c.UI.Error(err.Error()) |
| 68 | return 2 |
| 69 | } |
| 70 | |
| 71 | status, err := client.Sys().KeyStatus() |
| 72 | if err != nil { |
| 73 | c.UI.Error(fmt.Sprintf("Error reading key status: %s", err)) |
| 74 | return 2 |
| 75 | } |
| 76 | |
| 77 | switch Format(c.UI) { |
| 78 | case "table": |
| 79 | c.UI.Output(printKeyStatus(status)) |
| 80 | return 0 |
| 81 | default: |
| 82 | return OutputData(c.UI, status) |
| 83 | } |
| 84 | } |
nothing calls this directly
no test coverage detected