2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-23 05:12:10 +00:00

Rename debug dump related variable and run function

This commit is contained in:
Fabian Wickborn 2017-10-14 13:55:00 +02:00
parent 814e992c0b
commit cd5cbe0910

View File

@ -24,7 +24,7 @@ var cmdDebug = &cobra.Command{
Short: "Debug commands", Short: "Debug commands",
} }
var cmdDump = &cobra.Command{ var cmdDebugDump = &cobra.Command{
Use: "dump [indexes|snapshots|all|packs]", Use: "dump [indexes|snapshots|all|packs]",
Short: "Dump data structures", Short: "Dump data structures",
Long: ` Long: `
@ -32,13 +32,13 @@ The "dump" command dumps data structures from the repository as JSON objects. It
is used for debugging purposes only.`, is used for debugging purposes only.`,
DisableAutoGenTag: true, DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runDump(globalOptions, args) return runDebugDump(globalOptions, args)
}, },
} }
func init() { func init() {
cmdRoot.AddCommand(cmdDebug) cmdRoot.AddCommand(cmdDebug)
cmdDebug.AddCommand(cmdDump) cmdDebug.AddCommand(cmdDebugDump)
} }
func prettyPrintJSON(wr io.Writer, item interface{}) error { func prettyPrintJSON(wr io.Writer, item interface{}) error {
@ -165,7 +165,7 @@ func dumpIndexes(repo restic.Repository) error {
return nil return nil
} }
func runDump(gopts GlobalOptions, args []string) error { func runDebugDump(gopts GlobalOptions, args []string) error {
if len(args) != 1 { if len(args) != 1 {
return errors.Fatal("type not specified") return errors.Fatal("type not specified")
} }