diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-25 10:15:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-26 11:30:35 +0200 |
commit | f4a4ba9ac1b58b4726825400e1edd1bf47d4080a (patch) | |
tree | bac77ca71f40262110433cb4e53fbcb5dc54a42c /desktop/source/app/cmdlineargs.cxx | |
parent | 4972652eeba3ffa4d5055493d9275cfdc27b247c (diff) |
Clean up option processing
* Support --version on non-UNX, too.
* Consistently show the first unknown option and the help blob in the presence
of any unknown options.
* There is no need to tunnel --help/--version past oosplash in the soffice
script, as oosplash is prepared to treat them adequately (esp. not pass them
over any pipe); this only added unnecessary variance to what spellings exactly
are supported and how mixtures of --help, --version, and unknown options are
handled.
Change-Id: I617f2e727e2f0eafd34a2de3b85d441c6783ec4f
Diffstat (limited to 'desktop/source/app/cmdlineargs.cxx')
-rw-r--r-- | desktop/source/app/cmdlineargs.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 83b728fd4ff6..01e1f30eae62 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -287,26 +287,25 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) { bConversionOutEvent = true; } -#if defined UNX else // because it's impossible to filter these options that // are handled in the soffice shell script with the // primitive tools that /bin/sh offers, ignore them here - if (!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("backtrace")) && + if ( +#if defined UNX + !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("backtrace")) && !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("strace")) && !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("valgrind")) && // for X Session Management, handled in // vcl/unx/generic/app/sm.cxx: !oArg.match("session=") && +#endif //ignore additional legacy options that don't do anything anymore - !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("nocrashreport"))) + !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("nocrashreport")) && + m_unknown.isEmpty()) { - fprintf(stderr, "Unknown option %s\n", - rtl::OUStringToOString(aArg, osl_getThreadTextEncoding()).getStr()); - fprintf(stderr, "Run 'soffice --help' to see a full list of available command line options.\n"); - m_unknown = true; + m_unknown = aArg; } -#endif } else { @@ -624,7 +623,6 @@ void CommandLineArgs::InitParamValues() m_helpbase = false; m_psn = false; m_version = false; - m_unknown = false; m_splashpipe = false; m_bEmpty = true; m_bDocumentArgs = false; @@ -762,7 +760,7 @@ bool CommandLineArgs::IsVersion() const return m_version; } -bool CommandLineArgs::HasUnknown() const +OUString CommandLineArgs::GetUnknown() const { return m_unknown; } |