Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: gsutil.py

Issue 812223002: Args fix for gsutil.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Also use parse_known_args Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gsutil.py
diff --git a/gsutil.py b/gsutil.py
index e3f50d4687cdc687832b48b33ff21bf7f1341f3a..d383fa7e009f96e904401d2e12276a0bcc85f517 100755
--- a/gsutil.py
+++ b/gsutil.py
@@ -135,7 +135,11 @@ def parse_args():
parser.add_argument('--target', default=DEFAULT_BIN_DIR)
parser.add_argument('args', nargs=argparse.REMAINDER)
- args = parser.parse_args()
+ args, extras = parser.parse_known_args()
+ if args.args and args.args[0] == '--':
+ args.args.pop(0)
+ if extras:
+ args.args = extras + args.args
return args.force_version, args.fallback, args.target, args.args
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698