summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-06-14 06:47:31 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-06-14 06:47:31 +0000
commit0e794e0a4fbce26b57791634b588626ad40d99b1 (patch)
treebfe4e9f82f912064ea4f2298f12c687a6f05dc97
parentaace498f6c8042e0902b5b02905df987b1f1b077 (diff)
Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=742 : Add a "-d"
option to display only the printer "name" and "description", avoiding the far more expensive query done by "-l" (which opens a connection to the print server and queries all printer attributes).
-rw-r--r--xplsprinters.c8
-rw-r--r--xplsprinters.man15
-rw-r--r--xplsprinters.sgml23
3 files changed, 31 insertions, 15 deletions
diff --git a/xplsprinters.c b/xplsprinters.c
index 92fdd3d..d29a6fd 100644
--- a/xplsprinters.c
+++ b/xplsprinters.c
@@ -219,7 +219,7 @@ void print_detailed_printer_info(XPPrinterRec *xp_rec, int detailLevel)
}
printf("printer: %s\n", xp_rec->name);
- printf("\tcomment=%s\n", NULLSTR(xp_rec->desc));
+ printf("\tdescription=%s\n", NULLSTR(xp_rec->desc));
printf("\tmodel-identifier=%s\n", NULLSTR(XpGetOneAttribute(pdpy, pcontext, XPPrinterAttr, "xp-model-identifier")));
print_medium_sizes(pdpy, pcontext);
@@ -245,7 +245,7 @@ void print_printer_info(XPPrinterRec *xp_rec, int detailLevel)
if( detailLevel < 1 )
return;
- printf("\tcomment=%s\n", NULLSTR(xp_rec->desc));
+ printf("\tdescription=%s\n", NULLSTR(xp_rec->desc));
}
int main (int argc, char *argv[])
@@ -271,6 +271,10 @@ int main (int argc, char *argv[])
usage ();
printername = argv[i];
}
+ else if( !strncmp("-d", arg, len) )
+ {
+ details = 1;
+ }
else if( !strncmp("-l", arg, len) )
{
details = 2;
diff --git a/xplsprinters.man b/xplsprinters.man
index 3fb4f6b..7fa58ba 100644
--- a/xplsprinters.man
+++ b/xplsprinters.man
@@ -3,12 +3,12 @@
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng <steve@ggi-project.org>.
-.TH "XPLSPRINTERS" "__mansuffix__" "13 February 2004" "" ""
+.TH "XPLSPRINTERS" "__mansuffix__" "14 June 2004" "" ""
.SH NAME
xplsprinters \- shows a list of Xprint printers and it's attributes
.SH SYNOPSIS
-\fBxplsprinters\fR [ \fB-l\fR] [ \fB-printer \fIprintername\fB\fR] [ \fB-dump\fR] [ \fB-h\fR]
+\fBxplsprinters\fR [ \fB-printer \fIprintername\fB\fR] [ \fB-d\fR] [ \fB-l\fR] [ \fB-dump\fR] [ \fB-h\fR]
.SH "DESCRIPTION"
.PP
@@ -18,17 +18,20 @@ of printers and attributes supported for a specific list of
printers.
.SH "OPTIONS"
.TP
+\fB-printer \fIprintername\fB \fR
+printer to use
+.TP
\fB-dump \fR
dump all available printer attributes
.TP
\fB-h | -? \fR
print usage
.TP
+\fB-d \fR
+print description for each printer
+.TP
\fB-l \fR
list detailed printer attribute information
-.TP
-\fB-printer \fIprintername\fB \fR
-printer to use
.SH "ENVIRONMENT"
.TP
\fBXPSERVERLIST \fR
@@ -64,7 +67,7 @@ would print:
.nf
printer: ps002@castor:18
- comment=
+ description=
model-identifier=HPDJ1600C
default-medium=iso-a4
default-input-tray=
diff --git a/xplsprinters.sgml b/xplsprinters.sgml
index be6b044..99a20ea 100644
--- a/xplsprinters.sgml
+++ b/xplsprinters.sgml
@@ -27,10 +27,12 @@ manual volume numbers.
<cmdsynopsis>
<command>xplsprinters</command>
- <arg><option>-l</option></arg>
-
<arg><option>-printer <replaceable>printername</replaceable></option></arg>
+ <arg><option>-d</option></arg>
+
+ <arg><option>-l</option></arg>
+
<arg><option>-dump</option></arg>
<arg><option>-h</option></arg>
@@ -54,6 +56,13 @@ manual volume numbers.
<variablelist>
<varlistentry>
+ <term><option>-printer <replaceable>printername</replaceable></option>
+ </term>
+ <listitem>
+ <para>printer to use</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-dump</option>
</term>
<listitem>
@@ -68,17 +77,17 @@ manual volume numbers.
</listitem>
</varlistentry>
<varlistentry>
- <term><option>-l</option>
+ <term><option>-d</option>
</term>
<listitem>
- <para>list detailed printer attribute information</para>
+ <para>print description for each printer</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>-printer <replaceable>printername</replaceable></option>
+ <term><option>-l</option>
</term>
<listitem>
- <para>printer to use</para>
+ <para>list detailed printer attribute information</para>
</listitem>
</varlistentry>
</variablelist>
@@ -123,7 +132,7 @@ printer: xp_pdf_spooldir_tmp_Xprintjobs@meridian:19</computeroutput></screen>
<para>would print:
<screen><computeroutput>
printer: ps002@castor:18
- comment=
+ description=
model-identifier=HPDJ1600C
default-medium=iso-a4
default-input-tray=