Add --json flag support to more bd commands
- stats: Added --json flag for programmatic output - show, update: Added --json flag for issue details - close, reopen: Added --json flag for bulk operations - dep (add, remove, tree, cycles): Added --json flags - label (add, remove, list, list-all): Added --json flags - duplicates, merge: Added --json flags Closes bd-4dcd2d09
This commit is contained in:
@@ -206,6 +206,8 @@ var statsCmd = &cobra.Command{
|
||||
Use: "stats",
|
||||
Short: "Show statistics",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
jsonOutput, _ := cmd.Flags().GetBool("json")
|
||||
|
||||
// If daemon is running, use RPC
|
||||
if daemonClient != nil {
|
||||
resp, err := daemonClient.Stats()
|
||||
@@ -296,6 +298,8 @@ func init() {
|
||||
readyCmd.Flags().StringP("sort", "s", "hybrid", "Sort policy: hybrid (default), priority, oldest")
|
||||
readyCmd.Flags().Bool("json", false, "Output JSON format")
|
||||
|
||||
statsCmd.Flags().Bool("json", false, "Output JSON format")
|
||||
|
||||
rootCmd.AddCommand(readyCmd)
|
||||
rootCmd.AddCommand(blockedCmd)
|
||||
rootCmd.AddCommand(statsCmd)
|
||||
|
||||
Reference in New Issue
Block a user