From 725e5bfca5aeb78eebd0b939acc7c5c500c63049 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 23 Nov 2014 23:19:47 +0100 Subject: [PATCH] Require repository --- cmd/khepri/main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/khepri/main.go b/cmd/khepri/main.go index 64ac4e8b5..e3ccc3c6f 100644 --- a/cmd/khepri/main.go +++ b/cmd/khepri/main.go @@ -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 {