Fix #188: Add --json flag to blocked command
- Added --json flag registration for blockedCmd - Fixed blockedCmd to read json flag from cmd.Flags() - All commands now consistently support --json for agent use - Completes the fix started in earlier commits for show/update/close/stats
This commit is contained in:
@@ -153,6 +153,8 @@ var blockedCmd = &cobra.Command{
|
|||||||
Use: "blocked",
|
Use: "blocked",
|
||||||
Short: "Show blocked issues",
|
Short: "Show blocked issues",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
jsonOutput, _ := cmd.Flags().GetBool("json")
|
||||||
|
|
||||||
// If daemon is running but doesn't support this command, use direct storage
|
// If daemon is running but doesn't support this command, use direct storage
|
||||||
if daemonClient != nil && store == nil {
|
if daemonClient != nil && store == nil {
|
||||||
var err error
|
var err error
|
||||||
@@ -299,6 +301,7 @@ func init() {
|
|||||||
readyCmd.Flags().Bool("json", false, "Output JSON format")
|
readyCmd.Flags().Bool("json", false, "Output JSON format")
|
||||||
|
|
||||||
statsCmd.Flags().Bool("json", false, "Output JSON format")
|
statsCmd.Flags().Bool("json", false, "Output JSON format")
|
||||||
|
blockedCmd.Flags().Bool("json", false, "Output JSON format")
|
||||||
|
|
||||||
rootCmd.AddCommand(readyCmd)
|
rootCmd.AddCommand(readyCmd)
|
||||||
rootCmd.AddCommand(blockedCmd)
|
rootCmd.AddCommand(blockedCmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user