2 # Tab completion for FlightGear command line options.
4 # 1. define $FG_HOME (or accept the default "$HOME/.fgfs/")
6 # 2. source this file from your ~/.bashrc:
8 # [ -e $FG_HOME/fg-completion.bash ] && source $FG_HOME/fg-completion.bash
10 __fgfs_scriptname="fg-completion.bash" # adapt this if you renamed this script!
12 __fgfs_root=${FG_ROOT:-/usr/local/share/FlightGear}
13 __fgfs_home=${FG_HOME:-$HOME/.fgfs}
14 [ -d "$__fgfs_home" ] || mkdir -p "$__fgfs_home"
16 __fgfs_apt_list="$__fgfs_home/airport.list"
31 --disable-anti-alias-hud
32 --enable-anti-alias-hud
37 --disable-random-objects
38 --enable-random-objects
45 --disable-clock-freeze
47 --disable-splash-screen
48 --enable-splash-screen
49 --disable-mouse-pointer
50 --enable-mouse-pointer
54 --disable-enhanced-lighting
55 --enable-enhanced-lighting
56 --disable-distance-attenuation
57 --enable-distance-attenuation
58 --disable-specular-highlight
59 --enable-specular-highlight
75 --enable-auto-coordination
76 --disable-auto-coordination
80 --disable-real-weather-fetch
81 --enable-real-weather-fetch
82 --disable-horizon-effect
83 --enable-horizon-effect
90 --disable-save-on-exit
102 --aspect-ratio-multiplier=
177 if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} = "05b" ]] \
178 || [ ${BASH_VERSINFO[0]} -gt 2 ]; then
179 __fgfs_nospace="-o nospace"
185 __fgfs_ai_scenario() {
187 for i in $__fgfs_root/AI/*.xml; do
196 for i in $__fgfs_root/Aircraft/*/*-set.xml; do
206 [ "$i" == "${i%=}" ] && i="$i "
212 __fgfs_options=$(__fgfs_offer $__fgfs_options)
217 local IFS=$'\n'$'\t' cur=${COMP_WORDS[COMP_CWORD]} alt
221 alt=$(__fgfs_offer $(__fgfs_ai_scenario))
223 --aircraft=*|--vehicle=*)
224 alt=$(__fgfs_offer $(__fgfs_aircraft))
227 if [ -e "$__fgfs_apt_list" ]; then
228 alt=$(cat "$__fgfs_apt_list")
230 alt=$(__fgfs_offer khaf kpao koak kmry knuq ksjc kccr ksns krhv klvk o62 lpma)
234 alt=$(__fgfs_offer Nimitz Eisenhower Foch)
237 alt=$(__fgfs_offer joystick keyboard mouse)
240 alt=$(__fgfs_offer pitot static vacuum electrical)
243 alt=$(__fgfs_offer jsbsim yasim uiuc larcsim ufo magic)
246 alt=$(__fgfs_offer 640x480 800x600 1024x768 1152x864 1600x1200)
249 alt=$(__fgfs_offer bulk debug info warn alert)
252 alt=$(__fgfs_offer alpha beta early-production production)
255 alt=$(__fgfs_offer cat-1 cat-2 cat-3 cat-4 park-1)
258 alt=$(__fgfs_offer summer winter)
261 alt=$(__fgfs_offer real dawn morning noon afternoon dusk evening midnight)
267 alt="$__fgfs_options"
271 COMPREPLY=($(compgen -W "$alt" -- ${cur#*=}))
275 complete -o default $__fgfs_nospace -F __fgfs fgfs signs fgfsterra