]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
fix template for sh
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 15 Jan 2016 10:42:50 +0000 (11:42 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 15 Jan 2016 10:42:50 +0000 (11:42 +0100)
- adding man page and proper layout to template for shell scripts.

templates/default-sh.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 9971fa5..1c2d7d4
@@ -1,19 +1,68 @@
 #!/bin/${1:sh}
-# ----------------------------------------------------------------------
-#  `(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`: $0
-# ----------------------------------------------------------------------
-
-  OPT1="default value"   # Setup a default value
-  OPT2=0
-
-  while getopts "d:s" o
-  do  case "$o" in
-      d)  OPT1="$OPTARG";;
-      s)  OPT2=1;;
-      [?])    print >&2 "Usage: \$0 [-s] [-d seplist] file ..."
-          exit 1;;
-      esac
-  done
-  shift $(expr $OPTIND - 1)
-
-# ----------------------------------------------------------------------
+:<<=cut
+=pod
+
+=head1 NAME
+
+`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))` - $2
+
+=head1 DESCRIPTION
+
+
+=head1 SYNOPSIS
+
+  `(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`
+
+ --help, -h   for help
+ --man,  -m   to get this man page.
+ --verbose, -v be more verbose.
+
+=cut
+
+
+# parse parameters
+
+for param in "$@"
+do
+    case $param in
+       -k|--keep)
+           KEEP=1
+           shift # past argument=value
+           ;;
+       -v|--verbose)
+           VERBOSE=1
+           shift # past argument=value
+           ;;
+       -h|--help)
+           pod2usage $0
+           exit
+           ;;
+       -m|--man)
+           perldoc $0
+           exit
+           ;;
+       *)
+           echo "unknown option $param"
+           echo
+           pod2usage $0
+           exit
+           ;;
+    esac
+done
+
+EXITCODE=0
+
+$0
+
+:<<=cut
+=head1 AUTHOR
+
+
+`(user-full-name)` <`user-mail-address`>
+
+=head1 LICENSE
+
+This program is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut