]> git.lyx.org Git - lyx.git/commitdiff
Update of the bash completion script
authorScott Kostyshak <skostysh@lyx.org>
Tue, 25 Sep 2012 05:13:40 +0000 (01:13 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Tue, 25 Sep 2012 05:14:09 +0000 (01:14 -0400)
The -dbg options are updated and support is added for
-E, --export-to, -n, --no-remote, -r, --remote,
-f, and --force-overwrite.

lib/scripts/bash_completion

index 3b5b0cb529cda4cafe4c0931bdcc0ce51f8ba992..af50b3655b310051e082fe63ddbd1f7d61302cf6 100644 (file)
@@ -15,9 +15,15 @@ _lyx()
 
        local dbg_cmds=( "none info init key gui \
                        parser lyxrc kbmap latex mathed font tclass \
-                       lyxvc lyxserver roff action lyxlex depend insets \
+                       lyxvc lyxserver action lyxlex depend insets \
                        files workarea insettext graphics changes \
-                       external painting debug any" )
+                       external painting debug any undo scrolling \
+                       macros rtl locale selection find" )
+
+       # The below code would get rid of the hardcoding, but could be fragile:
+       # local dbg_cmds=$( lyx -dbg | awk '{print $2}' | tail -n +2 )
+       # If it is ever used, please put a comment in the code for -dbg output
+       # about breaking auto completion if the format is changed.
 
        #echo "cmds: '$dbg_cmds'"
 
@@ -28,7 +34,7 @@ _lyx()
        fi
 
        case "$last" in
-       +\(--export|-e\))
+       --export|-e)
                _filedir '+(pdf[1234]|PDF[1234]|pdf|PDF|ps|PS|xhtml|XHTML)';;
        -dbg)
                # check for multiple debug commands
@@ -38,13 +44,17 @@ _lyx()
                else
                        COMPREPLY=( $( compgen -W '$dbg_cmds' -- $cur ) )
                fi;;
+       --force-overwrite|-f)
+               COMPREPLY=( $( compgen -W 'all main none' -- $cur ) );;
        *)
           case "$cur" in
           -*)
                # LyX command line options
                 COMPREPLY=( $( compgen -W '-help -userdir -sysdir \
                                -geometry -dbg -x --execute -e --export \
-                               -i --import -version -batch ' -- $cur ) ) ;;
+                               -i --import -version -batch -E --export-to \
+                               -f --force-overwrite -n --no-remote \
+                               -r --remote ' -- $cur ) ) ;;
          
           *)
                # LyX files