mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 04:45:15 +00:00
Require repository
This commit is contained in:
parent
79a1ad50ee
commit
725e5bfca5
@ -140,15 +140,17 @@ func main() {
|
||||
log.SetOutput(os.Stdout)
|
||||
|
||||
opts.Repo = os.Getenv("KHEPRI_REPOSITORY")
|
||||
if opts.Repo == "" {
|
||||
opts.Repo = "khepri-backup"
|
||||
}
|
||||
|
||||
args, err := flags.Parse(&opts)
|
||||
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp {
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if opts.Repo == "" {
|
||||
fmt.Fprintf(os.Stderr, "no repository specified, use -r or KHEPRI_REPOSITORY variable\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if len(args) == 0 {
|
||||
cmds := []string{"init"}
|
||||
for k := range commands {
|
||||
|
Loading…
Reference in New Issue
Block a user