From 4996edc030eca9bb737ba4d27cfbe0d18e1af12f Mon Sep 17 00:00:00 2001 From: Outvi V <19144373+outloudvi@users.noreply.github.com> Date: Thu, 13 Feb 2020 18:18:23 +0800 Subject: [PATCH] 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. --- lib/oauthutil/oauthutil.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oauthutil/oauthutil.go b/lib/oauthutil/oauthutil.go index 8a07e1c71..61e1efb55 100644 --- a/lib/oauthutil/oauthutil.go +++ b/lib/oauthutil/oauthutil.go @@ -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) }