mirror of
https://github.com/Luzifer/dbx-sync.git
synced 2024-12-22 10:51:17 +00:00
Hide Dropbox API stuff when being verbose
This commit is contained in:
parent
40c2a0445b
commit
06b3dad398
1 changed files with 6 additions and 1 deletions
7
main.go
7
main.go
|
@ -16,6 +16,7 @@ import (
|
|||
|
||||
var (
|
||||
cfg = struct {
|
||||
Debug bool `flag:"debug" default:"false" description:"Turn on debug output"`
|
||||
DropboxToken string `flag:"dropbox-token" env:"DROPBOX_TOKEN" description:"Dropbox token to use to access API"`
|
||||
ForceOverwrite bool `flag:"force-overwrite" default:"false" description:"Upload files even when they exist on target"`
|
||||
Verbose bool `flag:"verbose,v" default:"false" description:"Enable verbose logging"`
|
||||
|
@ -34,6 +35,10 @@ func init() {
|
|||
fmt.Printf("dbx-sync %s\n", version)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if cfg.Debug {
|
||||
cfg.Verbose = true
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
@ -52,7 +57,7 @@ func main() {
|
|||
log.Fatalf("Destination prefix must start with '/': %q", destPrefix)
|
||||
}
|
||||
|
||||
config := dropbox.Config{Token: cfg.DropboxToken, Verbose: cfg.Verbose}
|
||||
config := dropbox.Config{Token: cfg.DropboxToken, Verbose: cfg.Debug}
|
||||
dbx := files.New(config)
|
||||
|
||||
remoteFilesPresent, err := getRemoteFileList(dbx, rconfig.Args()[2])
|
||||
|
|
Loading…
Reference in a new issue