Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On 2011-06-25, Jonathan) {$@(R.)daria.co.uk (Hudson wrote:

On Sat, 25 Jun 2011 13:58:14 +0200, lee wrote:

Tom Davies <tomdavies04@yahoo.co.uk> writes:

The error message is very specific.  It says "/home/lee/tmp/pdf does
not exist" which means there is no file called "pdf" in the
/home/lee/tmp folder.  Maybe he has missed the ending of the
file-name.  Or maybe he is looking in the wrong folder.

The message is even correct, only that's besides the point considering
what I was telling LO to do :)


The problem is the OP used double hyphens, when LO requires a single
hyphen, even for long options.

$ libreoffice -headless -convert-to pdf foo.odt works fine.

I've seen this described with one and two hyphens. Here, GNU/Linux, help
text shows only one hyphen.

But if I'm understanding the code (also see a message in the developers
list about the change[1]), the idea is to move long options to "--".

The code (in the source tree) currently recognizes both ways (one dash
and two dashes), and just warns the one-dash way is deprecated:

,----[desktop/source/app/cmdlineargs.cxx, line 648]
|     if (bDeprecated)
|     /* ... */
|         fprintf(stderr, "Warning: %s is deprecated.  Use -%s instead.\n", sArg.getStr(), 
sArg.getStr());
`----

Also, here is the detection code (comments are mine, they're not in
the code):

,----[desktop/source/app/cmdlineargs.cxx, line 417]
|     bool bDeprecated = false;
|
|     // If this is a long option (starts with two dashes) ...
|     if (aArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("--")))
|     {
|         // ... ignore the dashes.
|         oArg = ::rtl::OUString(aArg.getStr()+2, aArg.getLength()-2);
|     }
|
|     // Long options starting with a single dash are deprecated
|     else if (aArg.toChar() == '-')
|     {
|         // For now, ignore the dash and accept the argument, but 
|         // register the deprecated use (user will be warned later).
|         bDeprecated = true;
|         oArg = ::rtl::OUString(aArg.getStr()+1, aArg.getLength()-1);
|     }
`----

[I've not updated the source recently, so this is some days old. If
there were changes to the file, line numbers may have changed.]

Now I don't know if this is the code was used for the current builds. At
least LibreOffice 3.3.3 here does not recognize two dashes for long
options, and does not warn about single dash being deprecated.

If it isn't used for lee's build, it explains the error -- Tom is
right, I guess lee's LibO just ignored "--convert-to" and used "pdf" as
a filename to open. 

Lee, try with only one dash. (Yes, I'd not expect only a single dash for
long options, but it seems that this was, until recently, the way
LibO/OOo did it.)




[1] http://permalink.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/4529

-- 
Nuno J. Silva (aka njsg)
gopher://sdf-eu.org/1/users/njsg

-- 
Unsubscribe instructions: E-mail to users+help@global.libreoffice.org
In case of problems unsubscribing, write to postmaster@documentfoundation.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.