changeset 443:071f24359eef

Move "_ensure_no_optios()" into common.subr
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 03 May 2024 09:41:38 +0200
parents a2011285f054
children 84e43d1bd128
files sbin/ftjail share/local-bsdtools/common.subr
diffstat 2 files changed, 28 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/sbin/ftjail	Fri May 03 09:35:09 2024 +0200
+++ b/sbin/ftjail	Fri May 03 09:41:38 2024 +0200
@@ -56,30 +56,13 @@
   filesystem.
 '
 
-# Reset to standard umask
-umask 0022
+
+_p_datadir="$(dirname "$0")"/../share/local-bsdtools
+. "${_p_datadir}/common.subr"
 
 
-#:
-#: Ensure that no command line options are given
-#:
-#: Args:
-#:   $@:
-#:
-#: Exit:
-#:   2: If formally `getopts` finds options in "$@"
-#:
-#: Return:
-#:   - 0
-#:
-_ensure_no_options() {
-    local _opt
-
-    while getopts ":" _opt ; do
-        [ "${_opt}" = '?' ] && { echo "ERROR: no option allowed" 1>&2; exit 2; }
-    done
-    return 0
-}
+# Reset to standard umask
+umask 0022
 
 
 _get_dataset_for_mountpoint() {
--- a/share/local-bsdtools/common.subr	Fri May 03 09:35:09 2024 +0200
+++ b/share/local-bsdtools/common.subr	Fri May 03 09:41:38 2024 +0200
@@ -10,6 +10,29 @@
 #: :ID:        @(#)@@SIMPLEVERSIONTAG@@
 #:
 
+
+#:
+#: Ensure that no command line options are given
+#:
+#: Args:
+#:   $@:
+#:
+#: Exit:
+#:   2: If formally `getopts` finds options in "$@"
+#:
+#: Return:
+#:   - 0
+#:
+_ensure_no_options() {
+    local _opt
+
+    while getopts ":" _opt ; do
+        [ "${_opt}" = '?' ] && { echo "ERROR: no option allowed" 1>&2; exit 2; }
+    done
+    return 0
+}
+
+
 #:
 #: Determine some important dataset properties that are set locally
 #: