Create root command via function

This commit is contained in:
Michael Eischer
2025-02-07 21:29:33 +01:00
parent aa9cdf93cf
commit 412d6d9ec5
43 changed files with 163 additions and 215 deletions
+6 -4
View File
@@ -29,6 +29,12 @@ import (
"github.com/restic/restic/internal/restic"
)
func registerDebugCommand(cmd *cobra.Command) {
cmd.AddCommand(
newDebugCommand(),
)
}
func newDebugCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "debug",
@@ -41,10 +47,6 @@ func newDebugCommand() *cobra.Command {
return cmd
}
func init() {
cmdRoot.AddCommand(newDebugCommand())
}
func newDebugDumpCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "dump [indexes|snapshots|all|packs]",