Add atomic writes, humanized sizes, debug logging, and -v/-q per-command

- Atomic writes for mfer gen: writes to temp file, renames on success,
  cleans up temp on error/interrupt. Prevents empty manifests on Ctrl-C.
- Humanized byte sizes using dustin/go-humanize (e.g., "10 MiB" not "10485760")
- Progress lines clear when done (using ANSI escape \r\033[K])
- Debug logging when files are added to manifest (mfer gen -vv)
- Move -v/-q flags from global to per-command for better UX
- Add tests for atomic write behavior with failing filesystem mock
此提交包含在:
2025-12-17 15:57:20 -08:00
父節點 444a4c8f45
當前提交 c218fe56e9
共有 12 個檔案被更改,包括 276 行新增 和 86 行删除
+3 -2
查看文件
@@ -266,7 +266,8 @@ func Progressf(format string, args ...interface{}) {
pterm.Printf("\r"+format, args...)
}
// ProgressDone completes a progress line by printing a newline.
// ProgressDone clears the progress line when progress is complete.
func ProgressDone() {
pterm.Println()
// Clear the line with spaces and return to beginning
pterm.Print("\r\033[K")
}