Index: systemv/lpadmin.c =================================================================== --- systemv/lpadmin.c (revision 9755) +++ systemv/lpadmin.c (working copy) @@ -1127,7 +1127,10 @@ cups_file_t *in, /* PPD file */ *out; /* Temporary file */ const char *protocol, /* Old protocol option */ - *customval; /* Custom option value */ + *customval, /* Custom option value */ + *boolval; /* Boolean value */ + int wrote_ipp_supplies = 0, /* Wrote cupsIPPSupplies keyword? */ + wrote_snmp_supplies = 0;/* Wrote cupsSNMPSupplies keyword? */ DEBUG_printf(("set_printer_options(http=%p, printer=\"%s\", num_options=%d, " @@ -1256,7 +1259,27 @@ while (cupsFileGets(in, line, sizeof(line))) { - if (strncmp(line, "*Default", 8)) + if (!strncmp(line, "*cupsIPPSupplies:", 17) && + (boolval = cupsGetOption("cupsIPPSupplies", num_options, + options)) != NULL) + { + wrote_ipp_supplies = 1; + cupsFilePrintf(out, "*cupsIPPSupplies: %s\n", + (!strcasecmp(boolval, "true") || + !strcasecmp(boolval, "yes") || + !strcasecmp(boolval, "on")) ? "True" : "False"); + } + else if (!strncmp(line, "*cupsSNMPSupplies:", 18) && + (boolval = cupsGetOption("cupsSNMPSupplies", num_options, + options)) != NULL) + { + wrote_snmp_supplies = 1; + cupsFilePrintf(out, "*cupsSNMPSupplies: %s\n", + (!strcasecmp(boolval, "true") || + !strcasecmp(boolval, "yes") || + !strcasecmp(boolval, "on")) ? "True" : "False"); + } + else if (strncmp(line, "*Default", 8)) cupsFilePrintf(out, "%s\n", line); else { @@ -1306,6 +1329,26 @@ } } + if (!wrote_ipp_supplies && + (boolval = cupsGetOption("cupsIPPSupplies", num_options, + options)) != NULL) + { + cupsFilePrintf(out, "*cupsIPPSupplies: %s\n", + (!strcasecmp(boolval, "true") || + !strcasecmp(boolval, "yes") || + !strcasecmp(boolval, "on")) ? "True" : "False"); + } + + if (!wrote_snmp_supplies && + (boolval = cupsGetOption("cupsSNMPSupplies", num_options, + options)) != NULL) + { + cupsFilePrintf(out, "*cupsSNMPSupplies: %s\n", + (!strcasecmp(boolval, "true") || + !strcasecmp(boolval, "yes") || + !strcasecmp(boolval, "on")) ? "True" : "False"); + } + cupsFileClose(in); cupsFileClose(out); ppdClose(ppd); Index: man/lpadmin.man =================================================================== --- man/lpadmin.man (revision 9755) +++ man/lpadmin.man (working copy) @@ -12,7 +12,7 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH lpadmin 8 "CUPS" "7 January 2011" "Apple Inc." +.TH lpadmin 8 "CUPS" "10 May 2011" "Apple Inc." .SH NAME lpadmin \- configure cups printers and classes .SH SYNOPSIS @@ -82,6 +82,18 @@ \fImodel\fR directory or using one of the driver interfaces. Use the \fI-m\fR option with the \fIlpinfo(8)\fR command to get a list of supported models. .TP 5 +-o cupsIPPSupplies=true +.TP 5 +-o cupsIPPSupplies=false +.br +Specifies whether IPP supply level values should be reported. +.TP 5 +-o cupsSNMPSupplies=true +.TP 5 +-o cupsSNMPSupplies=false +.br +Specifies whether SNMP supply level (RFC 3805) values should be reported. +.TP 5 -o job-k-limit=value .br Sets the kilobyte limit for per-user quotas. The value is an @@ -123,8 +135,8 @@ .TP 5 -o printer-error-policy=name .br -Sets the error policy to be used when the printer backend is -unable to send the job to the printer. The name must be one of +Sets the error policy to be used when the printer backend is +unable to send the job to the printer. The name must be one of "abort-job", "retry-job", "retry-current-job", or "stop-printer". The default error policy is "stop-printer" for printers and "retry-current-job" for classes.