From: Michael Sweet Date: Fri, 16 Jun 2017 21:33:21 +0000 (-0400) Subject: Add queue type and printer-uri to long "lpstat -e" output. X-Git-Tag: v2.2.4~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62825d3445a090e1f73619c65732a7cdc8e7cb80;p=thirdparty%2Fcups.git Add queue type and printer-uri to long "lpstat -e" output. --- diff --git a/systemv/lpstat.c b/systemv/lpstat.c index 901cbefcb8..cda457173c 100644 --- a/systemv/lpstat.c +++ b/systemv/lpstat.c @@ -255,7 +255,18 @@ main(int argc, /* I - Number of command-line arguments */ fputs(dest->name, stdout); if (long_status) - printf(" %s\n", cupsGetOption("device-uri", dest->num_options, dest->options)); + { + const char *printer_uri_supported = cupsGetOption("printer-uri-supported", dest->num_options, dest->options); + const char *printer_is_temporary = cupsGetOption("printer-is-temporary", dest->num_options, dest->options); + const char *type = "network"; + + if (printer_is_temporary && !strcmp(printer_is_temporary, "true")) + type = "temporary"; + else if (printer_uri_supported) + type = "permanent"; + + printf(" %s %s %s\n", type, printer_uri_supported ? printer_uri_supported : "none", cupsGetOption("device-uri", dest->num_options, dest->options)); + } else putchar('\n'); }