mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-02 11:39:24 +01:00
Migrate reupload to cobra
This commit is contained in:
parent
c59de42008
commit
48e2a41d5c
19
client/cmd/reupload.go
Normal file
19
client/cmd/reupload.go
Normal 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)
|
||||
}
|
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user