Migrate reupload to cobra

This commit is contained in:
David Dworken 2022-11-14 19:29:48 -08:00
parent c59de42008
commit 48e2a41d5c
No known key found for this signature in database
2 changed files with 21 additions and 3 deletions

19
client/cmd/reupload.go Normal file
View File

@ -0,0 +1,19 @@
package cmd
import (
"github.com/ddworken/hishtory/client/hctx"
"github.com/ddworken/hishtory/client/lib"
"github.com/spf13/cobra"
)
var reuploadCmd = &cobra.Command{
Use: "reupload",
Short: "[Debug Only] Reupload your entire hiSHtory to all other devices",
Run: func(cmd *cobra.Command, args []string) {
lib.CheckFatalError(lib.Reupload(hctx.MakeContext()))
},
}
func init() {
rootCmd.AddCommand(reuploadCmd)
}

View File

@ -73,11 +73,10 @@ func main() {
fallthrough
case "config-add":
fallthrough
case "reupload":
fallthrough
case "config-delete":
cmd.Execute()
case "reupload":
// Purposefully undocumented since this command is generally not necessary to run
lib.CheckFatalError(lib.Reupload(hctx.MakeContext()))
case "-h":
fallthrough
case "help":