[cups.bugs] [MOD] STR #1872: Unknown -o option argument use not reported by lpr/lp

Kurt Pfeifle kpfeifle at danka.de
Fri Jul 28 10:25:29 PDT 2006


John A. Murdie <john at cs.york.ac.uk> wrote (Friday 28 July 2006 18:44):

> [STR New]
> 
> Am I missing something? I just accidentally used an incorrect option to
> lpr:
> 
> lpr -o sides=double-sided-long-edge HTMLPrimerPDF.pdf
> 
> What I meant, of course, was:
> 
> lpr -o sides=two-sided-long-edge HTMLPrimerPDF.pdf
> 
> and this last works and prints two-sided as I expect.
> 
> The bad first attempt didn't give rise to any error message on standard
> error at the command line, and the cupsd page.log shows 24 pages as having
> printed (just like the successful attempt), but of course it is printed
> single-sided.

Unknown job options are ignored by CUPS. This is the most sensible
approach to cater for robust printing.

Most printers uncapable to do duplex printing will print a PostScript
file that has duplexing commands embedded regardless -- they ignore
that option too, if they don't understand it.

> I have configured CUPS (via the 'Set Printer Options' page of the web
> admin interface) to have a duplexer. The printer has an appropriate PPD
> file configured for CUPS as far as I can tell.
> 
> I can't see anything to describe this apparent failing in the CUPS books,
> the CUPS web-site documentation or articles. Surely I've missed something?

Yes. "-o your_joboption=some_value" practically can have *any* 
arbitrary string. The reason is, that most options are taken from 
the PPD's content. And vendors are free to implement whatever cool
feature they want to develop for their products, and put their
invocation commands into the PPD. That's exactly what PPDs are meant
for....

> While I'd say that most people now print to CUPS from a GUI application,
> there's still a lot of command line usage. It is still important. I can
> forsee a lot of angry users turning up at my desk to tell me that their 
> command options have been ignored, and that they now have a bundle of
> expensive scrap paper.

Heh.   :->>

Let them face an angry administrator then, accusing them of using
the wrong commandline options and hence risking to waste paper :-)

> In case this report is turned into a feature request, I'd like the command
> to give something like the following error message on standard error and
> for nothing to be sent for printing:
> 
> $ lpr -o sides=double-sided-long-edge HTMLPrimerPDF.pdf
> lpr: error, unknown option "-o sides=double-sided-long-edge" (document not
> queued for printing)
> $

I don't think it makes sense, honestly. How should CUPS know that 
your option is really unknown? At the time your commandline is 
parsed, this is still not known. Only when the job arrived at the
"pstops" filter (which does the heavy lifting of parsing the PPD 
for job-option matches, and inserts the right invocations into
the PS that gets send further downstream) this may be revealed.
All filters ignore all unknown-to-themselves options, and handle
only the ones they know...

Cheers,
Kurt




More information about the cups mailing list