From d88c67e65a315e445401cdbe29b775ee0b307572 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 3 Jan 2011 22:05:41 -0500 Subject: Fixed coding style & updated the cmdline help to promote --foo style args. --- desktop/source/app/cmdlineargs.cxx | 11 +++++--- desktop/source/app/cmdlinehelp.cxx | 52 +++++++++++++++++++------------------- 2 files changed, 34 insertions(+), 29 deletions(-) (limited to 'desktop') diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 847ecdb7cac3..39c7a596193d 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -405,11 +405,16 @@ void CommandLineArgs::SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue ) sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& aArg, ::rtl::OUString& oArg ) { - if (aArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("--"))) { + if (aArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("--"))) + { oArg = ::rtl::OUString(aArg.getStr()+2, aArg.getLength()-2); - } else if (aArg.toChar() == '-') { + } + else if (aArg.toChar() == '-') + { oArg = ::rtl::OUString(aArg.getStr()+1, aArg.getLength()-1); - } else { + } + else + { return sal_False; } diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 9f9b9f722902..1ec327fe8de3 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -61,23 +61,23 @@ namespace desktop "\n"\ "Options:\n"; const char *aCmdLineHelp_left = - "-minimized \n"\ - "-invisible \n"\ - "-norestore \n"\ - "-quickstart \n"\ - "-nologo \n"\ - "-nolockcheck \n"\ - "-nodefault \n"\ - "-headless \n"\ - "-help/-h/-? \n"\ - "-writer \n"\ - "-calc \n"\ - "-draw \n"\ - "-impress \n"\ - "-base \n"\ - "-math \n"\ - "-global \n"\ - "-web \n"\ + "--minimized \n"\ + "--invisible \n"\ + "--norestore \n"\ + "--quickstart \n"\ + "--nologo \n"\ + "--nolockcheck \n"\ + "--nodefault \n"\ + "--headless \n"\ + "--help/-h/-? \n"\ + "--writer \n"\ + "--calc \n"\ + "--draw \n"\ + "--impress \n"\ + "--base \n"\ + "--math \n"\ + "--global \n"\ + "--web \n"\ "-o \n"\ "-n \n"; const char *aCmdLineHelp_right = @@ -101,31 +101,31 @@ namespace desktop "open documents regardless whether they are templates or not.\n"\ "always open documents as new files (use as template).\n"; const char *aCmdLineHelp_bottom = - "-display \n"\ + "--display \n"\ " Specify X-Display to use in Unix/X11 versions.\n" "-p \n"\ " print the specified documents on the default printer.\n"\ - "-pt \n"\ + "--pt \n"\ " print the specified documents on the specified printer.\n"\ - "-view \n"\ + "--view \n"\ " open the specified documents in viewer-(readonly-)mode.\n"\ - "-show \n"\ + "--show \n"\ " open the specified presentation and start it immediately\n"\ - "-accept=\n"\ + "--accept=\n"\ " Specify an UNO connect-string to create an UNO acceptor through which\n"\ " other programs can connect to access the API\n"\ - "-unaccept=\n"\ + "--unaccept=\n"\ " Close an acceptor that was created with -accept=\n"\ " Use -unnaccept=all to close all open acceptors\n"\ - "-infilter=\n"\ + "--infilter=\n"\ " Force an input filter type if possible\n"\ " Eg. -infilter=\"Calc Office Open XML\"\n"\ - "-convert-to output_file_extension[:output_filter_name] [-outdir ouput_dir] files\n"\ + "--convert-to output_file_extension[:output_filter_name] [-outdir ouput_dir] files\n"\ " Batch convert files.\n"\ " If -outdir is not specified then current working dir is used as output_dir.\n"\ " Eg. -convert-to pdf *.doc\n"\ " -convert-to pdf:writer_pdf_Export -outdir /home/user *.doc\n"\ - "-print-to-file [-printer-name printer_name] [-outdir ouput_dir] files\n"\ + "--print-to-file [-printer-name printer_name] [-outdir ouput_dir] files\n"\ " Batch print files to file.\n"\ " If -outdir is not specified then current working dir is used as output_dir.\n"\ " Eg. -print-to-file *.doc\n"\ -- cgit