| OLD | NEW |
| (Empty) |
| 1 #!/bin/sh | |
| 2 # Copyright (C) 2009 Google Inc. All rights reserved. | |
| 3 # | |
| 4 # Redistribution and use in source and binary forms, with or without | |
| 5 # modification, are permitted provided that the following conditions are | |
| 6 # met: | |
| 7 # | |
| 8 # * Redistributions of source code must retain the above copyright | |
| 9 # notice, this list of conditions and the following disclaimer. | |
| 10 # * Redistributions in binary form must reproduce the above | |
| 11 # copyright notice, this list of conditions and the following disclaimer | |
| 12 # in the documentation and/or other materials provided with the | |
| 13 # distribution. | |
| 14 # * Neither the name of Google Inc. nor the names of its | |
| 15 # contributors may be used to endorse or promote products derived from | |
| 16 # this software without specific prior written permission. | |
| 17 # | |
| 18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 29 # | |
| 30 # Command line completion for common commands used in WebKit development. | |
| 31 # | |
| 32 # Set-up: | |
| 33 # Add a line like this to your .bashrc: | |
| 34 # source /path/to/WebKitCode/Tools/Scripts/webkit-tools-completion.sh | |
| 35 | |
| 36 __webkit-patch_generate_reply() | |
| 37 { | |
| 38 COMPREPLY=( $(compgen -W "$1" -- "${COMP_WORDS[COMP_CWORD]}") ) | |
| 39 } | |
| 40 | |
| 41 __webkit-patch_upload_cc_generate_reply() | |
| 42 { | |
| 43 # Note: This won't work well if hostname completion is enabled, disable it w
ith: shopt -u hostcomplete | |
| 44 # Completion is done on tokens and our comma-separated list is one single to
ken, so we have to do completion on the whole list each time. | |
| 45 # Return a \n separated list for each possible bugzilla email completion of
the substring following the last comma. | |
| 46 # Redirect strerr to /dev/null to prevent noise in the shell if this ever br
eaks somehow. | |
| 47 COMPREPLY=( $(PYTHONPATH=$(dirname "${BASH_SOURCE[0]}") python -c " | |
| 48 import sys,re | |
| 49 from webkitpy.common.config.committers import CommitterList | |
| 50 m = re.match('((.*,)*)(.*)', sys.argv[1]) | |
| 51 untilLastComma = m.group(1) | |
| 52 afterLastComma = m.group(3) | |
| 53 print('\n'.join([untilLastComma + c.bugzilla_email() + ',' for c in CommitterLis
t().contributors() if c.bugzilla_email().startswith(afterLastComma)]))" "${COMP_
WORDS[COMP_CWORD]}" 2>/dev/null ) ) | |
| 54 } | |
| 55 | |
| 56 _webkit-patch_complete() | |
| 57 { | |
| 58 local command current_command="${COMP_WORDS[1]}" | |
| 59 case "$current_command" in | |
| 60 -h|--help) | |
| 61 command="help"; | |
| 62 ;; | |
| 63 *) | |
| 64 command="$current_command" | |
| 65 ;; | |
| 66 esac | |
| 67 | |
| 68 if [ $COMP_CWORD -eq 1 ]; then | |
| 69 __webkit-patch_generate_reply "--help" | |
| 70 return | |
| 71 fi | |
| 72 } | |
| 73 | |
| 74 complete -F _webkit-patch_complete webkit-patch | |
| 75 complete -o default -W "--continue --fix-merged --help --no-continue --no-warnin
gs --warnings -c -f -h -w" resolve-ChangeLogs | |
| 76 complete -o default -W "--bug --diff --git-commit --git-index --git-reviewer --h
elp --no-update --no-write --open --update --write -d -h -o" prepare-ChangeLog | |
| 77 complete -W "--clean --debug --help -h" build-webkit | |
| 78 complete -o default -W "--add-platform-exceptions --complex-text --configuration
--guard-malloc --help --http --ignore-tests --launch-safari --leaks --merge-lea
k-depth --new-test-results --no-http --no-show-results --no-sample-on-timeout --
no-strip-editing-callbacks --pixel-tests --platform --port --quiet --random --re
set-results --results-directory --reverse --root --sample-on-timeout --singly --
skipped --slowest --strict --strip-editing-callbacks --threaded --timeout --tole
rance --use-remote-links-to-tests --valgrind --verbose -1 -c -g -h -i -l -m -o -
p -q -t -v" run-webkit-tests | |
| OLD | NEW |