From owner-svn-src-head@FreeBSD.ORG Thu Nov 7 22:52:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 74B9DC5F; Thu, 7 Nov 2013 22:52:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 496932480; Thu, 7 Nov 2013 22:52:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA7MqBC3093808; Thu, 7 Nov 2013 22:52:11 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA7MqAaF093806; Thu, 7 Nov 2013 22:52:10 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311072252.rA7MqAaF093806@svn.freebsd.org> From: Devin Teske Date: Thu, 7 Nov 2013 22:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257826 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2013 22:52:11 -0000 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