From 18fb75f14a3930ebac0c3224cf8a394bd3537058 Mon Sep 17 00:00:00 2001 From: damionw Date: Thu, 28 Jan 2021 16:12:41 -0400 Subject: [PATCH] Allow auth_write to use nondefault credentials store --- gdrivefs/resources/scripts/gdfstool | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gdrivefs/resources/scripts/gdfstool b/gdrivefs/resources/scripts/gdfstool index 595aee7..c4db853 100755 --- a/gdrivefs/resources/scripts/gdfstool +++ b/gdrivefs/resources/scripts/gdfstool @@ -117,9 +117,16 @@ def _parser_auth_write(subparsers): filepath = gdrivefs.config.DEFAULT_CREDENTIALS_FILEPATH + s.add_argument('--auth-storage-file', + dest="auth_storage_file", + help='Authorization storage file', + action='store', + required=False, + default=filepath) + s.add_argument( 'authcode', - help="Authorize with the given code. Write to the default " \ + help="Authorize with the given code. Write to the specified " \ "credentials file-path: [{}]".format(filepath)) def _parser_auth_automatic(subparsers): @@ -175,7 +182,7 @@ def main(): if args.command == 'auth_get_url': _handle_auth_url() elif args.command == 'auth_write': - _auth_write(None, args.authcode) + _auth_write(args.auth_storage_file, args.authcode) elif args.command == 'auth_automatic': _handle_auth_automatic(args) elif args.command == 'mount':