M7: add verbose mode for debugging

Add -v/--verbose persistent flag that prints debug info to stderr:
D-Bus connection status, token plugin directory discovery, unlock method
sequencing with per-method success/failure, and full cryptsetup command
lines including LD_LIBRARY_PATH.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 08:37:08 -07:00
parent e44dd382dd
commit 0c19f94292
5 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package verbose
import (
"fmt"
"os"
)
// Enabled is set by the root command's --verbose flag.
var Enabled bool
// Printf prints to stderr if verbose mode is enabled.
func Printf(format string, args ...any) {
if Enabled {
fmt.Fprintf(os.Stderr, "arca: "+format+"\n", args...)
}
}