diff options
author | Brian Somers <brian@FreeBSD.org> | 2009-06-14 06:47:21 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 2009-06-14 06:47:21 +0000 |
commit | a0347c714809e03907a4973c00b661c126fa4304 (patch) | |
tree | 96a40a04677409418372d8eb2a9543663667f282 /usr.sbin | |
parent | 50a3e1d89e6033ef984698f5f53d244ed33e0b2f (diff) | |
download | src-a0347c714809e03907a4973c00b661c126fa4304.tar.gz src-a0347c714809e03907a4973c00b661c126fa4304.zip |
Add -m and -t options.
PR: 129554
Submitted by: gavin
MFC after: 3 weeks
Notes
Notes:
svn path=/head/; revision=194171
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/lpr/lp/lp.1 | 5 | ||||
-rw-r--r-- | usr.sbin/lpr/lp/lp.sh | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/lpr/lp/lp.1 b/usr.sbin/lpr/lp/lp.1 index 8ed842d55e57..903bb031f560 100644 --- a/usr.sbin/lpr/lp/lp.1 +++ b/usr.sbin/lpr/lp/lp.1 @@ -78,6 +78,8 @@ or .Ev PRINTER (with this precedence) are taken as the destination printer. +.It Fl m +Send mail upon completion. .It Fl n Ar num Specify that .Ar num @@ -91,6 +93,9 @@ Silent operation. Not supported, provided only as a compatibility option for .St -susv2 . +.It Fl t Ar title +Set the job title to +.Ar title . .El .Sh ENVIRONMENT As described above, the variables diff --git a/usr.sbin/lpr/lp/lp.sh b/usr.sbin/lpr/lp/lp.sh index e7c06882c0f9..03ad887b54d2 100644 --- a/usr.sbin/lpr/lp/lp.sh +++ b/usr.sbin/lpr/lp/lp.sh @@ -41,6 +41,8 @@ ncopies="" symlink="-s" +mailafter="" +title="" # Posix says LPDEST gets precedence over PRINTER dest=${LPDEST:-${PRINTER:-lp}} @@ -51,7 +53,7 @@ dest=${LPDEST:-${PRINTER:-lp}} # XXX We include the -s flag as a dummy. SUSv2 requires it, # although we do not yet emit the affected messages. # -while getopts "cd:n:o:s" option +while getopts "cd:mn:o:st:" option do case $option in @@ -59,12 +61,16 @@ do symlink="";; d) # destination dest="${OPTARG}";; + m) # mail after job + mailafter="-m";; n) # number of copies ncopies="-#${OPTARG}";; o) # (printer option) : ;; s) # (silent option) : ;; + t) # title for banner page + title="-J${OPTARG}";; *) # (error msg printed by getopts) exit 2;; esac @@ -72,4 +78,4 @@ done shift $(($OPTIND - 1)) -exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} "$@" +exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} "${title}" "$@" |