svn commit: r257826 - head/usr.sbin/sysrc
Devin Teske
dteske at FreeBSD.org
Thu Nov 7 22:52:11 UTC 2013
Author: dteske
Date: Thu Nov 7 22:52:10 2013
New Revision: 257826
URL: http://svnweb.freebsd.org/changeset/base/257826
Log:
Add new `--version' long option for getting the version (good for
comparing against the ports revision).
Modified:
head/usr.sbin/sysrc/sysrc
head/usr.sbin/sysrc/sysrc.8
Modified: head/usr.sbin/sysrc/sysrc
==============================================================================
--- head/usr.sbin/sysrc/sysrc Thu Nov 7 22:50:42 2013 (r257825)
+++ head/usr.sbin/sysrc/sysrc Thu Nov 7 22:52:10 2013 (r257826)
@@ -38,6 +38,11 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
############################################################ GLOBALS
#
+# Version information
+#
+SYSRC_VERSION="6.0 Nov-07,2013"
+
+#
# Options
#
DELETE=
@@ -133,6 +138,8 @@ help()
"Verbose. Print the pathname of the specific rc.conf(5)"
f_err "$optfmt" "" \
"file where the directive was found."
+ f_err "$optfmt" "--version" \
+ "Print version information to stdout and exit."
f_err "$optfmt" "-x" \
"Remove variable(s) from specified file(s)."
f_err "\n"
@@ -195,19 +202,22 @@ jail_depend()
[ $# -gt 0 ] || usage
#
-# Check for `--help' command-line option
+# Check for `--help' and `--version' command-line option
#
( # Operate in sub-shell to protect $@ in parent
while [ $# -gt 0 ]; do
case "$1" in
- --help) exit 1;;
+ --help) help ;;
+ --version) # see GLOBALS
+ echo "$SYSRC_VERSION"
+ exit 1 ;;
-[fRj]) # These flags take an argument
shift 1;;
esac
shift 1
done
exit 0
-) || help
+) || die
#
# Process command-line flags
Modified: head/usr.sbin/sysrc/sysrc.8
==============================================================================
--- head/usr.sbin/sysrc/sysrc.8 Thu Nov 7 22:50:42 2013 (r257825)
+++ head/usr.sbin/sysrc/sysrc.8 Thu Nov 7 22:52:10 2013 (r257826)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Jul 5, 2013
+.Dd Nov 7, 2013
.Dt SYSRC 8
.Os
.Sh NAME
@@ -112,6 +112,8 @@ Verbose.
Print the pathname of the specific
.Xr rc.conf 5
file where the directive was found.
+.It Fl -version
+Print version information to stdout and exit.
.It Fl x
Remove variable(s) from specified file(s).
.El
More information about the svn-src-all
mailing list