summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2011-10-19 20:16:01 +0200
committerPetr Mladek <pmladek@suse.cz>2011-10-19 20:16:01 +0200
commit3f845c2980fcb35ac7c6f4d75e9bb99dc772bab5 (patch)
treef53d343d2eb5b41f14062b0485e31f8414b93b87 /bin
parent369f22ceb8b3440d8caf1d60d7f45abc1d5ac258 (diff)
define bash completion also for 'loffice' wrapper (bnc#719656)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/generate-bash-completion52
1 files changed, 29 insertions, 23 deletions
diff --git a/bin/generate-bash-completion b/bin/generate-bash-completion
index ed34b18081de..0a7b233e9d55 100755
--- a/bin/generate-bash-completion
+++ b/bin/generate-bash-completion
@@ -43,6 +43,7 @@ my @EXTENSIONS=("oxt");
# use "" if you want to disable any wrapper
my %APPS = (
office => "libreoffice",
+ office_short => "loffice",
master => "",
base => "lobase",
calc => "localc",
@@ -65,6 +66,7 @@ sub usage()
print " $0 [--binsuffix=suffix]\n";
print "\t\t[--compat-oowrappers]\n";
print "\t\t[--office=wrapper_name]\n";
+ print "\t\t[--office-short=wrapper_name]\n";
print "\t\t[--master=wrapper_name]\n";
print "\t\t[--base=wrapper_name]\n";
print "\t\t[--calc=wrapper_name]\n";
@@ -97,22 +99,25 @@ foreach my $arg (@ARGV) {
usage();
exit 0;
} elsif ( $arg =~ /--compat-oowrappers/ ) {
- $APPS{'office'} = "ooffice";
- $APPS{'master'} = "";
- $APPS{'base'} = "oobase";
- $APPS{'calc'} = "oocalc";
- $APPS{'draw'} = "oodraw";
- $APPS{'impress'} = "ooimpress";
- $APPS{'math'} = "oomath";
- $APPS{'template'} = "oofromtemplate";
- $APPS{'unopkg'} = "unopkg";
- $APPS{'web'} = "ooweb";
- $APPS{'writer'} = "oowriter";
+ $APPS{'office'} = "openoffice";
+ $APPS{'office_short'} = "ooffice";
+ $APPS{'master'} = "";
+ $APPS{'base'} = "oobase";
+ $APPS{'calc'} = "oocalc";
+ $APPS{'draw'} = "oodraw";
+ $APPS{'impress'} = "ooimpress";
+ $APPS{'math'} = "oomath";
+ $APPS{'template'} = "oofromtemplate";
+ $APPS{'unopkg'} = "unopkg";
+ $APPS{'web'} = "ooweb";
+ $APPS{'writer'} = "oowriter";
$office_shell_function = "_ooexp_";
} elsif ( $arg =~ /--binsuffix=(.*)/ ) {
$binsuffix = "$1";
} elsif ( $arg =~ /--office=(.*)/ ) {
$APPS{'office'} = "$1";
+ } elsif ( $arg =~ /--office-short=(.*)/ ) {
+ $APPS{'office_short'} = "$1";
} elsif ( $arg =~ /--master=(.*)/ ) {
$APPS{'master'} = "$1";
} elsif ( $arg =~ /--base=(.*)/ ) {
@@ -182,19 +187,20 @@ sub print_suffixes_checks {
# skip the disabled wrapper
next if ( $APPS{$app} eq "" );
- if ($app eq "draw" ) { print_suffixes_check ($APPS{$app}, @DRAWDOCS); }
- if ($app eq "writer") { print_suffixes_check ($APPS{$app}, @WRITERDOCS, @MASTERDOCS); }
- if ($app eq "web") { print_suffixes_check ($APPS{$app}, @WEBDOCS); }
- if ($app eq "math") { print_suffixes_check ($APPS{$app}, @MATHDOCS); }
- if ($app eq "impress") { print_suffixes_check ($APPS{$app}, @IMPRESSDOCS); }
- if ($app eq "base") { print_suffixes_check ($APPS{$app}, @BASEDOCS); }
- if ($app eq "calc") { print_suffixes_check ($APPS{$app}, @CALCDOCS); }
- if ($app eq "master") { print_suffixes_check ($APPS{$app}, @MASTERDOCS); }
- if ($app eq "template") { print_suffixes_check ($APPS{$app}, @TEMPLATES); }
- # libreoffice should contain all...
- if ($app eq "office") { print_suffixes_check ($APPS{$app}, @DRAWDOCS, @WRITERDOCS, @MATHDOCS, @IMPRESSDOCS, @BASEDOCS, @CALCDOCS, @MASTERDOCS, @TEMPLATES, @WEBDOCS); }
+ if ($app eq "draw" ) { print_suffixes_check ($APPS{$app}, @DRAWDOCS); }
+ if ($app eq "writer") { print_suffixes_check ($APPS{$app}, @WRITERDOCS, @MASTERDOCS); }
+ if ($app eq "web") { print_suffixes_check ($APPS{$app}, @WEBDOCS); }
+ if ($app eq "math") { print_suffixes_check ($APPS{$app}, @MATHDOCS); }
+ if ($app eq "impress") { print_suffixes_check ($APPS{$app}, @IMPRESSDOCS); }
+ if ($app eq "base") { print_suffixes_check ($APPS{$app}, @BASEDOCS); }
+ if ($app eq "calc") { print_suffixes_check ($APPS{$app}, @CALCDOCS); }
+ if ($app eq "master") { print_suffixes_check ($APPS{$app}, @MASTERDOCS); }
+ if ($app eq "template") { print_suffixes_check ($APPS{$app}, @TEMPLATES); }
+ # libreoffice should contain all...
+ if (($app eq "office") || ($app eq "office_short"))
+ { print_suffixes_check ($APPS{$app}, @DRAWDOCS, @WRITERDOCS, @MATHDOCS, @IMPRESSDOCS, @BASEDOCS, @CALCDOCS, @MASTERDOCS, @TEMPLATES, @WEBDOCS); }
# unopkg is a standalone tool
- if ($app eq "unopkg") { print_suffixes_check ($APPS{$app}, @EXTENSIONS); }
+ if ($app eq "unopkg") { print_suffixes_check ($APPS{$app}, @EXTENSIONS); }
}
}