oauthutil: make instructions for rclone authorize more robust

It appends "--" to the rclone authorize command line before client_id,
in case that the client_id or client_secret has a prefix of "-"
(OneDrive's does), which affects the argument parsing.
This commit is contained in:
Outvi V 2020-02-13 18:18:23 +08:00 committed by GitHub
parent 964f1f6a7e
commit 4996edc030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -432,7 +432,7 @@ func doConfig(id, name string, m configmap.Mapper, oauthConfig *oauth2.Config, o
fmt.Printf("For this to work, you will need rclone available on a machine that has a web browser available.\n")
fmt.Printf("Execute the following on your machine (same rclone version recommended) :\n")
if changed {
fmt.Printf("\trclone authorize %q %q %q\n", id, oauthConfig.ClientID, oauthConfig.ClientSecret)
fmt.Printf("\trclone authorize %q -- %q %q\n", id, oauthConfig.ClientID, oauthConfig.ClientSecret)
} else {
fmt.Printf("\trclone authorize %q\n", id)
}