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>
17 lines
288 B
Go
17 lines
288 B
Go
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...)
|
|
}
|
|
}
|