| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Add programmable completion to some Chromium OS build scripts | 5 # Add programmable completion to some Chromium OS build scripts |
| 6 | 6 |
| 7 | 7 |
| 8 # Echo a list of -- flags that the current command accepts. The | 8 # Echo a list of -- flags that the current command accepts. The |
| 9 # function assumes that the command supports shflags' --help flag. | 9 # function assumes that the command supports shflags' --help flag. |
| 10 _flags() { | 10 _flags() { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 if [[ ${command} == "stop" ]] || [[ ${command} == "iterate" ]]; then | 164 if [[ ${command} == "stop" ]] || [[ ${command} == "iterate" ]]; then |
| 165 COMPREPLY=($(compgen -W "$(_cros_workon_list)" -- "$package")) | 165 COMPREPLY=($(compgen -W "$(_cros_workon_list)" -- "$package")) |
| 166 return 0 | 166 return 0 |
| 167 fi | 167 fi |
| 168 return 1 | 168 return 1 |
| 169 } | 169 } |
| 170 | 170 |
| 171 # Complete the cros_workon arguments. | 171 # Complete the cros_workon arguments. |
| 172 _cros_workon() { | 172 _cros_workon() { |
| 173 COMPREPLY=() | 173 COMPREPLY=() |
| 174 _cros_workon_command_complete && return 0 | |
| 175 _flag_complete && return 0 | 174 _flag_complete && return 0 |
| 176 _complete_board_sysroot_flag && return 0 | 175 _complete_board_sysroot_flag && return 0 |
| 176 _cros_workon_command_complete && return 0 |
| 177 _cros_workon_package_complete && return 0 | 177 _cros_workon_package_complete && return 0 |
| 178 return 0 | 178 return 0 |
| 179 } | 179 } |
| 180 | 180 |
| 181 complete -o bashdefault -o default -F _board_sysroot \ | 181 complete -o bashdefault -o default -F _board_sysroot \ |
| 182 build_autotest.sh \ | 182 build_autotest.sh \ |
| 183 build_image \ | 183 build_image \ |
| 184 build_packages \ | 184 build_packages \ |
| 185 image_to_usb.sh \ | 185 image_to_usb.sh \ |
| 186 mod_image_for_test.sh | 186 mod_image_for_test.sh |
| 187 complete -o bashdefault -o default -F _board_overlay setup_board | 187 complete -o bashdefault -o default -F _board_overlay setup_board |
| 188 complete -o bashdefault -o default -o nospace -F _autotest_complete autotest | 188 complete -o bashdefault -o default -o nospace -F _autotest_complete autotest |
| 189 complete -o bashdefault -o default -F _cros_workon cros_workon | 189 complete -o bashdefault -o default -F _cros_workon cros_workon |
| 190 | 190 |
| 191 ### Local Variables: | 191 ### Local Variables: |
| 192 ### mode: shell-script | 192 ### mode: shell-script |
| 193 ### End: | 193 ### End: |
| OLD | NEW |