From 48638456acee1f04a2f7ca6838e10ab44d8a91db Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Sep 27 2006 14:21:02 +0000 Subject: - Add '--help' option to lpr command (bug #206380, STR #1989). --- diff --git a/cups-lpr-help.patch b/cups-lpr-help.patch new file mode 100644 index 0000000..009a457 --- /dev/null +++ b/cups-lpr-help.patch @@ -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]); diff --git a/cups.spec b/cups.spec index 90af5a7..9ad18d3 100644 --- a/cups.spec +++ b/cups.spec @@ -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 1:1.2.4-3 +- Add '--help' option to lpr command (bug #206380, STR #1989). + * Fri Sep 22 2006 Tim Waugh 1:1.2.4-2 - 1.2.4 (bug #206763). No longer need str1968 patch.