mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
Tools: completion: get boards list from help
This commit is contained in:
parent
a415423975
commit
989653bf69
@ -51,14 +51,14 @@ _waf()
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# TODO: generate for waf help
|
|
||||||
case $prev in
|
case $prev in
|
||||||
--board)
|
--board)
|
||||||
opts="CubeBlack bbbmini fmuv2 fmuv3 fmuv4 iomcu sitl"
|
# get options between board and debug, remove everything before "are", remove everything after "--debug", remove final dot, remove all comma
|
||||||
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
opts=$(./waf --help | sed -n '/--board=/,/--debug/p' | sed -e 's/.*are //g' -e 's/\(--debug.*\)//g' -e 's/[.]//g' -e 's/[,]//g')
|
||||||
return 0
|
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
||||||
;;
|
return 0
|
||||||
esac
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
}
|
}
|
||||||
|
@ -37,18 +37,10 @@ _waf() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO : generate with regex from waf help
|
|
||||||
(( $+functions[_waf_boards] )) ||
|
(( $+functions[_waf_boards] )) ||
|
||||||
_waf_boards() {
|
_waf_boards() {
|
||||||
local boards; boards=(
|
# get option between board and debug, remove everything before "are", remove everything after "--debug", remove final dot, remove all comma
|
||||||
'CubeBlack:builds CubeBlack' \
|
local boards; boards=( $(./waf --help | sed -n '/--board=/,/--debug/p' | sed -e 's/.*are //g' -e 's/\(--debug.*\)//g' -e 's/[.]//g' -e 's/[,]//g') )
|
||||||
'bbbmini:build bbbmini' \
|
|
||||||
'fmuv2:build fmuv2' \
|
|
||||||
'fmuv3:build fmuv3' \
|
|
||||||
'fmuv4:build fmuv4' \
|
|
||||||
'iomcu:build iomcu' \
|
|
||||||
'sitl:build sitl'
|
|
||||||
)
|
|
||||||
_describe -t boards 'board' boards "$@" && ret=0
|
_describe -t boards 'board' boards "$@" && ret=0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user