#!/usr/bin/env perl # script to generate LibreOffice bash_completion file for the main applications # written by Rene Engelhard , Public Domain # updated for libreoffice-build by Petr Mladek , Public Domain # yes, this script probably is not real good code :) but still easier # to maintain than adding those entries statically many times in # a file... use strict; my @DRAWDOCS=("sxd", "std", "dxf", "emf", "eps", "met", "pct", "sgf", "sgv", "sda", "sdd", "vor", "svm", "wmf", "bmp", "gif", "jpg", "jpeg", "jfif", "fif", "jpe", "pcd", "pcx", "pgm", "png", "ppm", "psd", "ras", "tga", "tif", "tiff", "xbm", "xpm", "odg", "otg", "fodg", "odc", "odi", "sds", "wpg", "svg", "vdx", "vsd", "vsdm", "vsdx"); my @IMPRESSDOCS=("sxi", "sti", "ppt", "pps", "pot", "sxd", "sda", "sdd", "sdp", "vor", "cgm", "odp", "otp", "fodp", "ppsm", "ppsx", "pptm", "pptx", "potm", "potx"); my @TEMPLATES=("stw", "dot", "vor", "stc", "xlt", "sti", "pot", "std", "stw", "dotm", "dotx", "potm", "potx", "xltm", "xltx"); my @MATHDOCS=("sxm", "smf", "mml", "odf"); my @MASTERDOCS=("sxg", "odm", "sgl"); my @WRITERDOCS=("doc", "dot", "rtf", "sxw", "stw", "sdw", "vor", "txt", "htm?", "xml", "wp", "wpd", "wps", "odt", "ott", "fodt", "docm", "docx", "dotm", "dotx"); my @WEBDOCS=("htm", "html", "stw", "txt", "vor", "oth"); my @BASEDOCS=("odb"); my @CALCDOCS=("sxc", "stc", "dif", "dbf", "xls", "xlw", "xlt", "rtf", "sdc", "vor", "slk", "txt", "htm", "html", "wk1", "wks", "123", "xml", "ods", "ots", "fods", "csv", "xlsb", "xlsm", "xlsx", "xltm", "xltx"); my @EXTENSIONS=("oxt"); # default names of lowrappers # use "" if you want to disable any wrapper my %APPS = ( office => "libreoffice", office_short => "loffice", master => "", base => "lobase", calc => "localc", draw => "lodraw", impress => "loimpress", math => "lomath", template => "lofromtemplate", unopkg => "unopkg", web => "loweb", writer => "lowriter", ); my $office_shell_function = "_loexp_"; sub usage() { print "Script to Generate bash completion for LO wrappers\n\n"; print "Usage: $0 --help\n"; 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"; print "\t\t[--draw=wrapper_name]\n"; print "\t\t[--impress=wrapper_name]\n"; print "\t\t[--math=wrapper_name]\n"; print "\t\t[--template=wrapper_name]\n"; print "\t\t[--unopkg=wrapper_name]\n"; print "\t\t[--web=wrapper_name]\n"; print "\t\t[--writer=wrapper_name]\n"; print "\t\tinput_file\n"; print "\t\toutput_file\n\n"; print "Options:\n"; print "\t--help\t\tprint this help\n"; print "\t--binsuffix\tdefines a suffix that is added after each wrapper\n"; print "\t--compat-oowrappers\tset wrapper names to the old default oo* wrapper names\n"; print "The other options allows to redefine the wrapper names.\n"; print "The value \"\" can be used to disable any wrapper.\n\n"; } my $infilename; my $outfilename; my $binsuffix = ''; my $opt; foreach my $arg (@ARGV) { if ( $arg =~ /--help/ ) { usage(); exit 0; } elsif ( $arg =~ /--compat-oowrappers/ ) { $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=(.*)/ ) { $APPS{'base'} = "$1"; } elsif ( $arg =~ /--calc=(.*)/ ) { $APPS{'calc'} = "$1"; } elsif ( $arg =~ /--draw=(.*)/ ) { $APPS{'draw'} = "$1"; } elsif ( $arg =~ /--impress=(.*)/ ) { $APPS{'impress'} = "$1" } elsif ( $arg =~ /--math=(.*)/ ) { $APPS{'math'} = "$1"; } elsif ( $arg =~ /--template=(.*)/ ) { $APPS{'template'} = "$1"; } elsif ( $arg =~ /--unopkg=(.*)/ ) { $APPS{'unopkg'} = "$1"; } elsif ( $arg =~ /--web=(.*)/ ) { $APPS{'web'} = "$1"; } elsif ( $arg =~ /--writer=(.*)/ ) { $APPS{'writer'} = "$1" } elsif ( $arg =~ /^-.*/ ) { printf STDERR "Error: invalid option \"$arg\", try --help\n"; exit 1; } elsif ( $outfilename ) { printf STDERR "Error: too much arguments, try --help\n"; exit 1; } else { if ($infilename) { $outfilename = "$arg"; } else { $infilename = "$arg"; } } } unless ( $infilename ) { printf STDERR "Error: undefined input file, try --help\n"; exit 1; } unless ( $outfilename ) { printf STDERR "Error: undefined output file, try --help\n"; exit 1; } #add binsuffix foreach my $app (keys %APPS) { $APPS{$app} .= "$binsuffix" unless ( "$APPS{$app}" eq "" ); } sub print_suffixes_check { my $app = shift(@_); my $first_suffix = shift(@_); ($first_suffix) || die "Error: No suffix defined for $app\n"; print BCOUTFILE " $app)\t\te=\'!*.+(" . $first_suffix . "|" . uc($first_suffix); foreach my $suffix (@_) { print BCOUTFILE "|" . $suffix; print BCOUTFILE "|" . uc($suffix); } print BCOUTFILE ")\' ;;\n"; } sub print_suffixes_checks { foreach my $app (keys %APPS) { # 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") || ($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); } } } sub print_apps { my $app_to_print; foreach my $app (keys %APPS) { # skip the disabled wrapper next if ( $APPS{$app} eq "" ); print BCOUTFILE "\t\t\t\t\t$app_to_print \\\n" if ($app_to_print); $app_to_print = $APPS{$app}; } # the last app will be printed without the final backslash ($app_to_print) || die "Error: No LO wrapper was selected\n"; print BCOUTFILE "\t\t\t\t\t$app_to_print\n"; } open (BCINFILE, "$infilename") || die "Error: can't open $infilename for reading: $!\n"; open (BCOUTFILE, "> $outfilename") || die "Error: can't open $outfilename for writing: $!\n"; while (my $line = ) { chomp $line; $line =~ s/\@OFFICE_SHELL_FUNCTION\@/$office_shell_function/; if ($line =~ m/\@BASH_COMPLETION_SUFFIXES_CHECKS\@/) { print_suffixes_checks(); } elsif ($line =~ m/\@BASH_COMPLETION_OOO_APPS\@/) { print_apps(); } else { print BCOUTFILE "$line\n"; } } close (BCINFILE); close (BCOUTFILE); ntu/oneiric-3.4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-06-09cppcheck: noExplicitConstructorCaolán McNamara
Change-Id: Ic33ee6936f40bec4f3a82aea39a180ae6e9a0928
2015-04-15remove unnecessary use of void in function declarationsNoel Grandin
ie. void f(void); becomes void f(); I used the following command to make the changes: git grep -lP '\(\s*void\s*\)' -- *.cxx \ | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;' and ran it for both .cxx and .hxx files. Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-01Replace remaining getCppuType et al with cppu::UnoTypeStephan Bergmann
Change-Id: I620bf5d46c19f0182e822265eadf8eb11001855e
2015-03-25TyposJulien Nabet
Change-Id: I665a56fcad10e136e949a10497f6ab8813af9968
2014-10-29remove unnecessary 'using namespace rtl' declarationsNoel Grandin
It turns out that almost none of them were necessary. Change-Id: I1311ed28409c682b57ea8d149bcbaf2c49133e83 Reviewed-on: https://gerrit.libreoffice.org/12133 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-06-05cppuhelper: remove SAL_THROW macroNoel Grandin
Change-Id: I54141071396d04e7bead56da14a665b8556ba6d2
2014-06-04cppuhelper: fix includesThomas Arnhold
Change-Id: I0e6bc822d19cf266dea716fe92f2ccd08d87c51f
2014-06-02fdo#68849: Add header guards to all include filesJens Carl
added header guards for directories basebmp/, chart2/, cppuhelper/, include/test/, io/test/, sax/test, shell/, writerfilter/, and xmlhelp/ Change-Id: I0e29a9b75c26d71f58aa98986b52f6d3b46015a6 Reviewed-on: https://gerrit.libreoffice.org/9615 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-23remove boilerplate in UNO Exception constructor callsNoel Grandin
Now that we have default values for Exception constructor params, remove lots of boilerplate code. Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-11Fix previous commitJulien Nabet
Change-Id: Iebd7674cc8afb547821878dd1565b0f300d22f1f
2014-05-11Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part10Julien Nabet
Change-Id: I67acda35fa127547dcea0cd18c9dc16db7c00294
2014-04-19fixincludeguards.sh: some smaller dirsThomas Arnhold
Change-Id: Ic25bd678dc299627299b22145efd7bebcf2b39d0
2014-02-27Remove visual noise from cppuhelperAlexander Wilms
Change-Id: If23a1aa19949f91f900d55ff9e1d5039378d7277 Reviewed-on: https://gerrit.libreoffice.org/8248 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23Remove unneccessary commentsAlexander Wilms
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb Reviewed-on: https://gerrit.libreoffice.org/8182 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-03Remove needless SAL_DLLPRIVATE annotationsStephan Bergmann
Change-Id: Iaf2d742ae3dcc15a915a996805955d93daac9d45
2014-01-10[API CHANGE] cppu::Enterable::v_isValid returns boolStephan Bergmann
While strictly speaking an incompatible change, it is extremely unlikely that external code uses cppu::Enterable at all; this should always have been a private URE implementation detail. Change-Id: I2c3fe754fe6268b18ca03532229f3403736f6f6e
2013-12-16fdo#72598 Remove SunStudio cruft from code baseJelle van der Waa
Change-Id: I5150eec33228e18e274a8ae4effd3f185851b7f4 Reviewed-on: https://gerrit.libreoffice.org/7103 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2013-12-16Clean-up uno/lbnames.hStephan Bergmann
Change-Id: I4bd729499aa8be58f04194656e35c1f79d5d4919
2013-11-19remove most use of RTL_CONSTASCII_USTRINGPARAM macroNoel Grandin
This is largely unnecessary when working with OUString Change-Id: I3cf4d68357a43665d01162ef4a2d5346a45da9be
2013-11-11remove unnecessary use of OUString constructorNoel Grandin
Change-Id: Ifb220af71857ddacd64e8204fb6d3e4aad8eef71
2013-11-04remove redundant calls to OUString constructor in if expressionNoel Grandin
Convert code like: if( aStr == OUString("xxxx") ) to this: if( aStr == "xxxx" ) Change-Id: I8d201f048477731eff590fb988259ef0935c080c
2013-10-31solver doesn't solve anything...Michael Stahl
... it is an abbreviation of "Solar Version". Since nobody can remember that: remove OUTDIR OUTDIR_FOR_BUILD SOLARVER SOLARVERSION solarpath and any mention thereof. Change-Id: Idb3031c4f25a76ac05b22ec67e3ca3e1e8e512ad Reviewed-on: https://gerrit.libreoffice.org/6515 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2013-10-23remove RTL_CONSTASCII_(U)STRINGPARAMChr. Rossmanith
Change-Id: I0bce921bfc7102b9a33b1c87eee3ddec0ebaed7b Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, with one little typo fix
2013-09-22add mode lines to new files (and idls) since last runCaolán McNamara
Change-Id: Id1e74f18c90e69d1a781c8f02e30dc3c005ed4fd