package cli import ( "github.com/spf13/cobra" ) // RootFlags holds global flags type RootFlags struct { Verbose bool Debug bool } var rootFlags RootFlags // NewRootCommand creates the root cobra command func NewRootCommand() *cobra.Command { cmd := &cobra.Command{ Use: "vaultik", Short: "Secure incremental backup tool with asymmetric encryption", Long: `vaultik is a secure incremental backup daemon that encrypts data using age public keys and uploads to S3-compatible storage. No private keys are needed on the source system.`, SilenceUsage: true, } // Add global flags cmd.PersistentFlags().BoolVarP(&rootFlags.Verbose, "verbose", "v", false, "Enable verbose output") cmd.PersistentFlags().BoolVar(&rootFlags.Debug, "debug", false, "Enable debug output") // Add subcommands cmd.AddCommand( NewBackupCommand(), NewRestoreCommand(), NewPruneCommand(), NewVerifyCommand(), NewFetchCommand(), SnapshotCmd(), ) return cmd } // GetRootFlags returns the global flags func GetRootFlags() RootFlags { return rootFlags }