- Add '--help' option to lpr command (bug #206380, STR #1989).

This commit is contained in:
Tim Waugh 2006-09-27 14:21:02 +00:00
parent bd257fc576
commit 48638456ac
2 changed files with 52 additions and 1 deletions

46
cups-lpr-help.patch Normal file
View File

@ -0,0 +1,46 @@
--- cups-1.2.4/berkeley/lpr.c.lpr-help 2006-09-27 14:44:34.000000000 +0100
+++ cups-1.2.4/berkeley/lpr.c 2006-09-27 14:59:16.000000000 +0100
@@ -58,6 +58,30 @@
char tempfile[1024]; /* Temporary file for printing from stdin */
+static void
+usage (const char *name)
+{
+ _cupsLangPrintf(stdout,
+"Usage: %s [OPTION] [ file(s) ]\n"
+"Print files.\n\n"
+" -E force encryption\n"
+" -H server[:port] specify alternate server\n"
+" -C title, -J title, -T title\n"
+" set the job name\n\n"
+" -P destination/instance print to named printer\n"
+" -U username specify alternate username\n"
+" -# num-copies set number of copies\n"
+" -h disable banner printing\n"
+" -l print without filtering\n"
+" -m send email on completion\n"
+" -o option[=value] set a job option\n"
+" -p format text file with header\n"
+" -q hold job for printing\n"
+" -r delete files after printing\n"
+"\nWith no file given, read standard input.\n"
+, name);
+}
+
/*
* 'main()' - Parse options and send files for printing.
@@ -324,6 +348,12 @@
break;
default :
+ if (!strcmp (argv[i], "--help"))
+ {
+ usage (argv[0]);
+ return (0);
+ }
+
_cupsLangPrintf(stderr,
_("%s: Error - unknown option \'%c\'!\n"),
argv[0], argv[i][1]);

View File

@ -6,7 +6,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.2.4
Release: 2
Release: 3
License: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@ -35,6 +35,7 @@ Patch10: cups-no-export-ssllibs.patch
Patch11: cups-paps.patch
Patch12: cups-wbuffer.patch
Patch13: cups-direct-usb.patch
Patch14: cups-lpr-help.patch
Patch15: cups-maxlogsize.patch
Patch16: cups-pid.patch
Patch17: cups-relro.patch
@ -133,6 +134,7 @@ lpd emulation.
%patch11 -p1 -b .paps
%patch12 -p1 -b .wbuffer
%patch13 -p1 -b .direct-usb
%patch14 -p1 -b .lpr-help
%patch15 -p1 -b .maxlogsize
%patch16 -p1 -b .pid
%patch17 -p1 -b .relro
@ -414,6 +416,9 @@ rm -rf $RPM_BUILD_ROOT
%{cups_serverbin}/daemon/cups-lpd
%changelog
* Wed Sep 27 2006 Tim Waugh <twaugh@redhat.com> 1:1.2.4-3
- Add '--help' option to lpr command (bug #206380, STR #1989).
* Fri Sep 22 2006 Tim Waugh <twaugh@redhat.com> 1:1.2.4-2
- 1.2.4 (bug #206763). No longer need str1968 patch.