2023-07-18 12:05:22 +02:00
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" ,
2023-07-18 15:00:12 +02:00
Long : ` A tool to manage backup files and directories to Backblaze. ` ,
2023-07-18 12:05:22 +02:00
}
func init ( ) {
2023-08-27 21:30:19 +02:00
rootCmd . AddCommand ( cmd . Sync , cmd . Versions , cmd . Cleanup , cmd . Check )
2023-07-18 12:05:22 +02:00
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" )
2023-08-12 09:52:04 +02:00
2023-08-27 21:30:19 +02:00
cmd . Check . PersistentFlags ( ) . String ( "dir" , "" , "Specifies the absolute path of the directory containing the backup files to be compared against the Backblaze B2 bucket. This flag is mutually exclusive with the 'file' flag." )
cmd . Check . PersistentFlags ( ) . String ( "bucket" , "" , "Name of the Backblaze B2 bucket against which the local files or directory will be compared." )
2023-08-12 09:52:04 +02:00
cmd . Cleanup . PersistentFlags ( ) . String ( "bucket" , "" , "backblaze bucket name" )
2023-07-18 12:05:22 +02:00
}
func main ( ) {
2023-08-27 21:30:19 +02:00
if err := rootCmd . Execute ( ) ; err != nil {
2023-07-18 12:05:22 +02:00
fmt . Println ( err )
os . Exit ( 1 )
}
}