bd sync: 2025-10-31 22:39:53

This commit is contained in:
Steve Yegge
2025-10-31 22:39:53 -07:00
parent c2d3ad2d63
commit acb731a4ec
10 changed files with 119 additions and 9 deletions

View File

@@ -308,6 +308,21 @@ Output to stdout by default, or use -o flag for file output.`,
fmt.Fprintf(os.Stderr, "Warning: failed to set file permissions: %v\n", err)
}
}
// Output statistics if JSON format requested
if jsonOutput {
stats := map[string]interface{}{
"success": true,
"exported": len(exportedIDs),
"skipped": skippedCount,
"total_issues": len(issues),
}
if output != "" {
stats["output_file"] = output
}
data, _ := json.MarshalIndent(stats, "", " ")
fmt.Fprintln(os.Stderr, string(data))
}
},
}
@@ -316,5 +331,6 @@ func init() {
exportCmd.Flags().StringP("output", "o", "", "Output file (default: stdout)")
exportCmd.Flags().StringP("status", "s", "", "Filter by status")
exportCmd.Flags().Bool("force", false, "Force export even if database is empty")
exportCmd.Flags().BoolVar(&jsonOutput, "json", false, "Output export statistics in JSON format")
rootCmd.AddCommand(exportCmd)
}