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

Unified Diff: fetch.py

Issue 358203002: Make fetch help display all known recipes. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: rebase Created 6 years, 4 months 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: fetch.py
diff --git a/fetch.py b/fetch.py
index 897356f299c5aaaeff22b71f44c9259b3b24f867..f5640cc95a2ea0a70df6788732842f8fa76b328b 100755
--- a/fetch.py
+++ b/fetch.py
@@ -21,9 +21,10 @@ These parameters will be passed through to the recipe's main method.
import json
import optparse
import os
+import pipes
import subprocess
import sys
-import pipes
+import textwrap
from distutils import spawn
@@ -197,20 +198,24 @@ def usage(msg=None):
if msg:
print 'Error:', msg
- print (
-"""
-usage: %s [options] <recipe> [--property=value [--property2=value2 ...]]
-
-This script can be used to download the Chromium sources. See
-http://www.chromium.org/developers/how-tos/get-the-code
-for full usage instructions.
-
-Valid options:
- -h, --help, help Print this message.
- --nohooks Don't run hooks after checkout.
- -n, --dry-run Don't run commands, only print them.
- --no-history Perform shallow clones, don't fetch the full git history.
-""" % os.path.basename(sys.argv[0]))
+ print textwrap.dedent("""\
+ usage: %s [options] <recipe> [--property=value [--property2=value2 ...]]
+
+ This script can be used to download the Chromium sources. See
+ http://www.chromium.org/developers/how-tos/get-the-code
+ for full usage instructions.
+
+ Valid options:
+ -h, --help, help Print this message.
+ --nohooks Don't run hooks after checkout.
+ -n, --dry-run Don't run commands, only print them.
+ --no-history Perform shallow clones, don't fetch the full git history.
+
+ Valid fetch recipes:""") % os.path.basename(sys.argv[0])
+ for fname in os.listdir(os.path.join(SCRIPT_PATH, 'recipes')):
+ if fname.endswith('.py'):
+ print ' ' + fname[:-3]
+
sys.exit(bool(msg))
« 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