summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common')
-rwxr-xr-xlib/common14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/common b/lib/common
index 473c8b1..2214480 100755
--- a/lib/common
+++ b/lib/common
@@ -62,3 +62,17 @@ grep_path() {
find `echo $path | tr : " "` -type f -executable 2>/dev/null | (egrep "$regex" || exit 0)
}
+
+assert_valid_app_name() {
+ local app="$1"; shift
+
+ local re="^[a-zA-Z][a-zA-Z0-9]*$"
+ if [[ ! $app =~ $re ]]
+ then
+ fatal "Invalid app name: \"$app\""
+ fi
+}
+
+# Save for later
+usage_app=${0##*/}
+echo_debug=${echo_debug-no}