Showing 1 changed files with 10 additions and 4 deletions
+10 -4
.fgfs/fgfs_function
... ...
@@ -94,6 +94,11 @@ function fgfs () {
94 94
                 fgfs_args+=("--multiplay=out,10,mpserver${BASH_REMATCH[2]}.flightgear.org,5000")
95 95
                 test -z "$bash_rematch_set" && set +o BASH_REMATCH
96 96
 
97
+############ DEMANDE DE TRACE DE VOL ?
98
+            elif [[ $fgfs_arg == "log" ]]; then
99
+                # option construite plus tard avec nom de l'appareil
100
+                local log_requested=1
101
+
97 102
 ############ AEROPORT ?
98 103
             else 
99 104
                 local candidate_airport=${fgfs_arg%:*}; [[ $candidate_airport == $fgfs_arg ]] && candidate_airport=${fgfs_arg%+*}
... ...
@@ -147,13 +152,12 @@ function fgfs () {
147 152
                     return
148 153
                     ;;
149 154
                 --(show-aircraft|help))
150
-                    typeset -A complement=(
155
+                    local -A complement=(
151 156
                         --show-aircraft --fg-aircraft=$FGADDON/Aircraft
152 157
                         --help          --verbose
153 158
                     )
154 159
                     export LD_LIBRARY_PATH=$(ld_library_path)
155 160
                     $FGDIR/install/flightgear/bin/fgfs $fgfs_arg ${complement[$fgfs_arg]} 2>/dev/null | pager
156
-                    unset complement
157 161
                     return
158 162
                     ;;
159 163
                 *)
... ...
@@ -162,8 +166,10 @@ function fgfs () {
162 166
         fi
163 167
     done
164 168
     unset fgfs_arg
165
-#    test -z "$aircraft" && echo "avion non trouvé" && return
166
-#    test -z "$airport"  && echo "aéroport inconnu" && return
169
+    if [[ -n "$log_requested" && -z "${fgfs_args[(r)--igc=*]}" ]]; then
170
+        fgfs_args+=(--igc=file,out,1,$(date +%Y%m%d.${${${fgfs_args[(r)--aircraft=*]}#--aircraft=}:-$(sed -rn 's|^.+aircraft>(.+)</aircraft.+$|\1|p' $FGDIR/source/fgdata/defaults.xml)}.igc))
171
+    fi
172
+
167 173
     export LD_LIBRARY_PATH=$(ld_library_path)
168 174
 
169 175
     echo ${fgfs_args[@]}