Showing 1 changed files with 12 additions and 1 deletions
+12 -1
flightgear/fgfs_function
... ...
@@ -494,7 +494,18 @@ function fgfs () {
494 494
                     fi
495 495
                     ;;
496 496
                 *)
497
-                    fgfs_args+=($fgfs_arg);;
497
+                    completion_source="$FGDIR/install/flightgear/share/zsh/site-functions/_fgfs"
498
+                    if test -r "$completion_source"; then
499
+                        if egrep --quiet "^\s*'${fgfs_arg%=*}=?\[" "$completion_source"; then
500
+                            fgfs_args+=($fgfs_arg)
501
+                        else
502
+                            echo unknown option: ${fgfs_arg%=*}
503
+                            return 1
504
+                        fi
505
+                    else
506
+                        fgfs_args+=($fgfs_arg)
507
+                    fi
508
+                    ;;
498 509
             esac
499 510
         fi
500 511
     done