git: fc7eb8c4a765 - main - examples/jails: New version of jib (9.0)

Devin Teske <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a8904d3.37528.5f125d1d__11096.0066945822$1787364581$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by dteske:

URL: https://cgit.FreeBSD.org/src/commit/?id=fc7eb8c4a76594ad6ce40c43d507248f431c3f9a

commit fc7eb8c4a76594ad6ce40c43d507248f431c3f9a
Author:     Devin Teske <[email protected]>
AuthorDate: 2026-08-22 02:06:46 +0000
Commit:     Devin Teske <[email protected]>
CommitDate: 2026-08-22 02:06:46 +0000

    examples/jails: New version of jib (9.0)
    
    Add $Version, -h/-v, and SPDX-License-Identifier: BSD-2-Clause.
    Drop the long-form license and bump the copyright to 2026.
    
    MFC after:      1 week
---
 share/examples/jails/jib | 43 ++++++++++++++++++-------------------------
 1 file changed, 18 insertions(+), 25 deletions(-)

diff --git a/share/examples/jails/jib b/share/examples/jails/jib
index 55d908438b3e..a4de22da2b49 100755
--- a/share/examples/jails/jib
+++ b/share/examples/jails/jib
@@ -1,33 +1,13 @@
 #!/bin/sh
-#-
-# Copyright (c) 2016 Devin Teske
-# All rights reserved.
 #
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
+# SPDX-License-Identifier: BSD-2-Clause
 #
+# Copyright (c) 2016-2026 Devin Teske <[email protected]>
 #
 ############################################################ IDENT(1)
 #
 # $Title: if_bridge(4) management script for vnet jails $
+# $Version: 9.0 $
 #
 ############################################################ INFORMATION
 #
@@ -131,6 +111,8 @@
 #
 ############################################################ GLOBALS
 
+VERSION='$Version: 9.0 $'
+
 pgm="${0##*/}" # Program basename
 
 #
@@ -143,10 +125,14 @@ FAILURE=1
 
 usage()
 {
+	local optfmt="\t%-5s %s\n"
 	local action usage descr
 	exec >&2
-	echo "Usage: $pgm action [arguments]"
-	echo "Actions:"
+	printf "Usage: %s [-hv] action [arguments]\n" "$pgm"
+	printf "Options:\n"
+	printf "$optfmt" "-h" "Print this usage statement and exit."
+	printf "$optfmt" "-v" "Print version information and exit."
+	printf "Actions:\n"
 	for action in \
 		addm		\
 		show		\
@@ -399,6 +385,13 @@ action="$1"
 #
 # Validate action argument
 #
+case "$action" in
+-h) usage ;; # NOTREACHED
+-v) VERSION="${VERSION#*: }"
+	echo "${VERSION% $}"
+	exit $SUCCESS ;;
+-*) usage ;; # NOTREACHED
+esac
 if [ "$BASH_VERSION" ]; then
 	type="$( type -t "jib_$action" )" || usage # NOTREACHED
 else
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.