fix(json): audit and standardize JSON output across commands (bd-au0.7)
Audit findings: - All commands properly respect --json flag for success output - Added outputJSONError() helper for consistent JSON error output - Removed redundant local --json flag from stale.go (inherited from rootCmd) - Fixed stale_test.go to check InheritedFlags() instead of local Flags() JSON output patterns verified across: - Query commands: ready, blocked, stale, count, stats, status - Dep commands: dep add/remove/tree/cycles - Label commands: label add/remove/list/list-all - Comment commands: comments add/list - Epic commands: epic status/close-eligible 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,6 +110,6 @@ func init() {
|
||||
staleCmd.Flags().IntP("days", "d", 30, "Issues not updated in this many days")
|
||||
staleCmd.Flags().StringP("status", "s", "", "Filter by status (open|in_progress|blocked|deferred)")
|
||||
staleCmd.Flags().IntP("limit", "n", 50, "Maximum issues to show")
|
||||
staleCmd.Flags().BoolVar(&jsonOutput, "json", false, "Output JSON format")
|
||||
// Note: --json flag is defined as a persistent flag in main.go, not here
|
||||
rootCmd.AddCommand(staleCmd)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user