30 lines
719 B
Go
30 lines
719 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"gitea.urkob.com/urko/backblaze-backup/cmd"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "backblaze-backup",
|
|
Short: "Backblaze backup tool",
|
|
Long: `A tool to backup files and directories to Backblaze.`,
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(cmd.Sync, cmd.Versions)
|
|
cmd.Sync.PersistentFlags().String("file", "", "absolute path of the file you want to upload to backblaze")
|
|
cmd.Sync.PersistentFlags().String("dir", "", "absolute path of the directory you want to upload to backblaze")
|
|
cmd.Sync.PersistentFlags().String("bucket", "", "backblaze bucket name")
|
|
}
|
|
|
|
func main() {
|
|
if err := cmd.Sync.Execute(); err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
}
|