mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 12:55:18 +00:00
Require repository
This commit is contained in:
parent
79a1ad50ee
commit
725e5bfca5
@ -140,15 +140,17 @@ func main() {
|
|||||||
log.SetOutput(os.Stdout)
|
log.SetOutput(os.Stdout)
|
||||||
|
|
||||||
opts.Repo = os.Getenv("KHEPRI_REPOSITORY")
|
opts.Repo = os.Getenv("KHEPRI_REPOSITORY")
|
||||||
if opts.Repo == "" {
|
|
||||||
opts.Repo = "khepri-backup"
|
|
||||||
}
|
|
||||||
|
|
||||||
args, err := flags.Parse(&opts)
|
args, err := flags.Parse(&opts)
|
||||||
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp {
|
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp {
|
||||||
os.Exit(0)
|
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 {
|
if len(args) == 0 {
|
||||||
cmds := []string{"init"}
|
cmds := []string{"init"}
|
||||||
for k := range commands {
|
for k := range commands {
|
||||||
|
Loading…
Reference in New Issue
Block a user