- Fixed the "cancel all jobs" function in the web interface for several
languages (Issue #4999)
- Fixed issues with local queues (Issue #5003, Issue #5008, Issue #5009)
+- The `lpstat` command now supports a `-e` option to enumerate local printers
+ (either previously added or on the network) that can be accessed.
CHANGES IN CUPS V2.2.3
.\"
.\" lpstat man page for CUPS.
.\"
-.\" Copyright 2007-2014 by Apple Inc.
+.\" Copyright 2007-2017 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" 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 lpstat 1 "CUPS" "12 June 2014" "Apple Inc."
+.TH lpstat 1 "CUPS" "26 May 2017" "Apple Inc."
.SH NAME
lpstat \- print cups status information
.SH SYNOPSIS
] ] [
.B \-d
] [
+.B \-e
+] [
.B \-o
[
.I destination(s)
.B \-d
Shows the current default destination.
.TP 5
+.B \-e
+Shows all available destinations on the local network.
+.TP 5
\fB\-h \fIserver\fR[\fB:\fIport\fR]
Specifies an alternate server.
.TP 5
Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", and "#".
Also, printer and class names are \fInot\fR case-sensitive.
.LP
-The \fI\-h\fR, \fI\-E\fR, \fI\-U\fR, and \fI\-W\fR options are unique to CUPS.
+The \fI\-h\fR, \fI-e\fR, \fI\-E\fR, \fI\-U\fR, and \fI\-W\fR options are unique to CUPS.
.LP
The Solaris \fI\-f\fR, \fI\-P\fR, and \fI\-S\fR options are silently ignored.
.SH SEE ALSO
/*
* "lpstat" command for CUPS.
*
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
static void check_dest(const char *command, const char *name,
int *num_dests, cups_dest_t **dests);
+static int enum_cb(void *user_data, unsigned flags, cups_dest_t *dest);
static int match_list(const char *list, const char *name);
static int show_accepting(const char *printers, int num_dests,
cups_dest_t *dests);
show_default(dests);
break;
+ case 'e' : /* List destinations */
+ op = 'e';
+ cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, enum_cb, NULL);
+ break;
+
case 'f' : /* Show forms */
op = 'f';
if (opt[1] != '\0')
}
+/*
+ * 'enum_cb()' - Print a destination on the standard output.
+ */
+
+static int /* O - 1 to continue */
+enum_cb(void *user_data, /* I - User data (unused) */
+ unsigned flags, /* I - Enumeration flags */
+ cups_dest_t *dest) /* I - Destination */
+{
+ (void)user_data;
+
+ if (!(flags & CUPS_DEST_FLAGS_REMOVED))
+ {
+ if (dest->instance)
+ printf("%s/%s\n", dest->name, dest->instance);
+ else
+ puts(dest->name);
+ }
+
+ return (1);
+}
+
+
/*
* 'match_list()' - Match a name from a list of comma or space-separated names.
*/