]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - systemv/lpstat.c
License change: Apache License, Version 2.0.
[thirdparty/cups.git] / systemv / lpstat.c
index 5d3654dbfa1e0e28c44250d129de67999429b265..96d4acc85756a0bb129888c5e0d874ef3285587c 100644 (file)
@@ -4,11 +4,7 @@
  * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2006 by Easy Software Products.
  *
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file.  If this file is
- * missing or damaged, see the license at "http://www.cups.org/".
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
  */
 
 /*
@@ -250,9 +246,25 @@ main(int  argc,                            /* I - Number of command-line arguments */
                 for (j = num_temp, dest = temp; j > 0; j --, dest ++)
                 {
                   if (dest->instance)
-                    printf("%s/%s\n", dest->name, dest->instance);
+                    printf("%s/%s", dest->name, dest->instance);
                   else
-                    puts(dest->name);
+                    fputs(dest->name, stdout);
+
+                  if (long_status)
+                  {
+                    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');
                 }
 
                 cupsFreeDests(num_temp, temp);
@@ -1779,20 +1791,16 @@ show_printers(const char  *printers,    /* I - Destinations */
         switch (pstate)
        {
          case IPP_PRINTER_IDLE :
-             _cupsLangPrintf(stdout,
-                             _("printer %s is idle.  enabled since %s"),
-                             printer, printer_state_time);
+             if (ippContainsString(reasons, "hold-new-jobs"))
+               _cupsLangPrintf(stdout, _("printer %s is holding new jobs.  enabled since %s"), printer, printer_state_time);
+             else
+               _cupsLangPrintf(stdout, _("printer %s is idle.  enabled since %s"), printer, printer_state_time);
              break;
          case IPP_PRINTER_PROCESSING :
-             _cupsLangPrintf(stdout,
-                             _("printer %s now printing %s-%d.  "
-                               "enabled since %s"),
-                             printer, printer, jobid, printer_state_time);
+             _cupsLangPrintf(stdout, _("printer %s now printing %s-%d.  enabled since %s"), printer, printer, jobid, printer_state_time);
              break;
          case IPP_PRINTER_STOPPED :
-             _cupsLangPrintf(stdout,
-                             _("printer %s disabled since %s -"),
-                             printer, printer_state_time);
+             _cupsLangPrintf(stdout, _("printer %s disabled since %s -"), printer, printer_state_time);
              break;
        }