Meng yu | 99dbc83 | 2023-12-22 15:52:06 +0800 | [diff] [blame^] | 1 | |
| 2 | source fip/variables.sh |
| 3 | |
| 4 | in_bootloade=0 |
| 5 | |
| 6 | __mk() { |
| 7 | local cur prev |
| 8 | |
| 9 | COMPREPLY=() |
| 10 | cur=`_get_cword` |
| 11 | prev=${COMP_WORDS[COMP_CWORD-1]} |
| 12 | |
| 13 | case "$prev" in |
| 14 | ./mk) |
| 15 | COMPREPLY=( $( compgen -W "$(ls ${BL33_DEFCFG1}/ ${BL33_DEFCFG2}/ \ |
| 16 | ${BL33_DEFCFG3}/ 2>/dev/null |sed -n '/_defconfig/p;'|sed 's/_defconfig//g') " -- $cur) ) |
| 17 | |
| 18 | if [[ -z $COMPREPLY ]]; then |
| 19 | #echo "not generating COMPREPLY or not in bootloader" |
| 20 | in_bootloader=0 |
| 21 | else |
| 22 | #echo "Generating COMPREPLY in bootloader" |
| 23 | in_bootloader=1 |
| 24 | fi |
| 25 | ;; |
| 26 | *) |
| 27 | if [[ $in_bootloader == 1 ]]; then |
| 28 | COMPREPLY=( $( compgen -W "$(echo ${COMPILE_PARA_LIST[@]})" -- $cur) ) |
| 29 | fi |
| 30 | |
| 31 | ;; |
| 32 | esac |
| 33 | } |
| 34 | |
| 35 | complete -F __mk mk |
| 36 | complete -r ./mk 2>/dev/null |