summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2015-06-05 14:30:58 +0200
committerMatthias Beyer <mail@beyermatthias.de>2015-06-05 14:36:22 +0200
commit0ffbe2a032640714688f4e5ff0b5f15219edef59 (patch)
tree3eedbd81e24b1265ba2cd21729b9a0dc0c65bef2
parent30ebeccee311766c2be457dcaa707b5055e7e6b4 (diff)
Add functions to generate parts of help-text
-rw-r--r--nix-utils.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/nix-utils.sh b/nix-utils.sh
index 6df996e..98fd94b 100644
--- a/nix-utils.sh
+++ b/nix-utils.sh
@@ -12,3 +12,20 @@ stdout() {
[ $VERBOSE -eq 1 ] && echo -e "${Green}[$(basename $0)]:${Color_Off} $*"
}
+scriptname_to_command() {
+ echo "$1" | sed 's,^\.\/nix-script-,,' | sed 's,\.sh$,,'
+}
+
+help_synopsis() {
+ SCRIPT=$(scriptname_to_command $1); shift
+ echo "usage: nix-script $SCRIPT $*"
+}
+
+help_end() {
+ echo -e "\tAdding '-v' before the '$1' command turns on verbosity"
+ echo -e ""
+ echo -e "\tReleased under terms of GPLv2"
+ echo -e "\t(c) 2015 Matthias Beyer"
+ echo ""
+}
+