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

@@ -4,6 +4,7 @@ import (
"fmt"
"os"
"git.wntrmute.dev/kyle/arca/internal/verbose"
"github.com/spf13/cobra"
)
@@ -12,6 +13,10 @@ var rootCmd = &cobra.Command{
Short: "Mount and unmount LUKS-encrypted volumes",
}
func init() {
rootCmd.PersistentFlags().BoolVarP(&verbose.Enabled, "verbose", "v", false, "print debug information to stderr")
}
func SetVersion(v string) {
rootCmd.Version = v
}