2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-16 01:57:10 +00:00
This commit is contained in:
Alexander Neumann 2018-05-04 00:24:37 +02:00
parent 1fbcf63830
commit 0c078cc205
2 changed files with 4 additions and 5 deletions

View File

@ -43,7 +43,6 @@ var version = "compiled manually"
type GlobalOptions struct { type GlobalOptions struct {
config.Config config.Config
PasswordFile string
Quiet bool Quiet bool
Verbose int Verbose int
NoLock bool NoLock bool
@ -91,8 +90,8 @@ func init() {
// these fields are embedded in config.Config and queried via f.Get[...]() // these fields are embedded in config.Config and queried via f.Get[...]()
f.StringP("repo", "r", "", "repository to backup to or restore from (default: $RESTIC_REPOSITORY)") f.StringP("repo", "r", "", "repository to backup to or restore from (default: $RESTIC_REPOSITORY)")
f.StringP("password-file", "p", "", "read the repository password from a file (default: $RESTIC_PASSWORD_FILE)")
f.StringVarP(&globalOptions.PasswordFile, "password-file", "p", os.Getenv("RESTIC_PASSWORD_FILE"), "read the repository password from a file (default: $RESTIC_PASSWORD_FILE)")
f.BoolVarP(&globalOptions.Quiet, "quiet", "q", false, "do not output comprehensive progress report") f.BoolVarP(&globalOptions.Quiet, "quiet", "q", false, "do not output comprehensive progress report")
f.CountVarP(&globalOptions.Verbose, "verbose", "v", "be verbose (specify --verbose multiple times or level `n`)") f.CountVarP(&globalOptions.Verbose, "verbose", "v", "be verbose (specify --verbose multiple times or level `n`)")
f.BoolVar(&globalOptions.NoLock, "no-lock", false, "do not lock the repo, this allows some operations on read-only repos") f.BoolVar(&globalOptions.NoLock, "no-lock", false, "do not lock the repo, this allows some operations on read-only repos")

View File

@ -15,9 +15,9 @@ import (
// Config contains configuration items read from a file. // Config contains configuration items read from a file.
type Config struct { type Config struct {
Repo string `config:"repo" flag:"repo" env:"RESTIC_REPOSITORY"` Repo string `config:"repo" flag:"repo" env:"RESTIC_REPOSITORY"`
Password string `config:"password" env:"RESTIC_PASSWORD"` Password string `config:"password" env:"RESTIC_PASSWORD"`
PasswordFile string `config:` PasswordFile string `config:"password_file" flag:"password-file" env:"RESTIC_PASSWORD_FILE"`
Backends map[string]Backend `config:"backend"` Backends map[string]Backend `config:"backend"`
Backup *Backup `config:"backup"` Backup *Backup `config:"backup"`