diff options
| author | Clawd <ai@clawd.bot> | 2026-02-15 18:54:22 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-02-15 18:54:22 -0800 |
| commit | 4c20fb334315e5b4e0c5892a6b68a205687ff7d9 (patch) | |
| tree | 2c56b30209b6822bfee1b202917753eddbcdc996 /cmd | |
| parent | d6740a0be72a776db555d4bb6ccfa4a04da6570a (diff) | |
feat(v2): wire up v2 as default interface
- main.go: v2 JSON interface is now default
- Set SHIP_V1=1 to use legacy human-formatted output
- initV2() called before rootV2Cmd.Execute()
v2 rebuild complete - ready for testing
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/ship/main.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cmd/ship/main.go b/cmd/ship/main.go index f7d95c1..73d9a20 100644 --- a/cmd/ship/main.go +++ b/cmd/ship/main.go | |||
| @@ -6,8 +6,20 @@ import ( | |||
| 6 | ) | 6 | ) |
| 7 | 7 | ||
| 8 | func main() { | 8 | func main() { |
| 9 | if err := rootCmd.Execute(); err != nil { | 9 | // Use v2 (agent-first JSON) interface by default |
| 10 | fmt.Fprintf(os.Stderr, "Error: %v\n", err) | 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() | ||
| 21 | if err := rootV2Cmd.Execute(); err != nil { | ||
| 22 | // Error already printed as JSON by commands | ||
| 11 | os.Exit(1) | 23 | os.Exit(1) |
| 12 | } | 24 | } |
| 13 | } | 25 | } |
