summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/tools/create_html.py
diff options
context:
space:
mode:
authorsbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-31 16:40:09 +0000
committersbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-31 16:40:09 +0000
commit1d335baac2463c91c453cd38ff64476349146364 (patch)
treecb80d1e7fc07e0ef911aaac43cf136e711926eed /native_client_sdk/src/tools/create_html.py
parent94030a6b1184b7d2c562fddf3026bb78cf00c6db (diff)
downloadchromium_src-1d335baac2463c91c453cd38ff64476349146364.zip
chromium_src-1d335baac2463c91c453cd38ff64476349146364.tar.gz
chromium_src-1d335baac2463c91c453cd38ff64476349146364.tar.bz2
[NaCl SDK] Enable bash completion for python-based command line tools.
Also, add a top level docstring to create_nmf.py. R=binji@chromium.org Review URL: https://codereview.chromium.org/53833002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/tools/create_html.py')
-rwxr-xr-xnative_client_sdk/src/tools/create_html.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/native_client_sdk/src/tools/create_html.py b/native_client_sdk/src/tools/create_html.py
index 8634d4a..6b8a2df 100755
--- a/native_client_sdk/src/tools/create_html.py
+++ b/native_client_sdk/src/tools/create_html.py
@@ -155,9 +155,8 @@ def CreateHTML(filenames, options):
def main(argv):
usage = 'Usage: %prog [options] <.nexe/.pexe or .nmf>'
- description = __doc__
epilog = 'Example: create_html.py -o index.html my_nexe.nexe'
- parser = optparse.OptionParser(usage, description=description, epilog=epilog)
+ parser = optparse.OptionParser(usage, description=__doc__, epilog=epilog)
parser.add_option('-v', '--verbose', action='store_true',
help='Verbose output')
parser.add_option('-d', '--debug-libs', action='store_true',
@@ -167,6 +166,15 @@ def main(argv):
'input name with .html extension)',
metavar='FILE')
+ # To enable bash completion for this command first install optcomplete
+ # and then add this line to your .bashrc:
+ # complete -F _optcomplete create_html.py
+ try:
+ import optcomplete
+ optcomplete.autocomplete(parser)
+ except ImportError:
+ pass
+
options, args = parser.parse_args(argv)
if not args: