diff options
Diffstat (limited to 'cmd/ship/main.go')
| -rw-r--r-- | cmd/ship/main.go | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/cmd/ship/main.go b/cmd/ship/main.go index 73d9a20..17516fb 100644 --- a/cmd/ship/main.go +++ b/cmd/ship/main.go | |||
| @@ -1,25 +1,10 @@ | |||
| 1 | package main | 1 | package main |
| 2 | 2 | ||
| 3 | import ( | 3 | import "os" |
| 4 | "fmt" | ||
| 5 | "os" | ||
| 6 | ) | ||
| 7 | 4 | ||
| 8 | func main() { | 5 | func main() { |
| 9 | // Use v2 (agent-first JSON) interface by default | ||
| 10 | // Set SHIP_V1=1 to use legacy human-formatted output | ||
| 11 | if os.Getenv("SHIP_V1") == "1" { | ||
| 12 | if err := rootCmd.Execute(); err != nil { | ||
| 13 | fmt.Fprintf(os.Stderr, "Error: %v\n", err) | ||
| 14 | os.Exit(1) | ||
| 15 | } | ||
| 16 | return | ||
| 17 | } | ||
| 18 | |||
| 19 | // v2: JSON output by default | ||
| 20 | initV2() | 6 | initV2() |
| 21 | if err := rootV2Cmd.Execute(); err != nil { | 7 | if err := rootV2Cmd.Execute(); err != nil { |
| 22 | // Error already printed as JSON by commands | ||
| 23 | os.Exit(1) | 8 | os.Exit(1) |
| 24 | } | 9 | } |
| 25 | } | 10 | } |
