]> pd.if.org Git - zpackage/blobdiff - zpm
let newpackage set additional fields
[zpackage] / zpm
diff --git a/zpm b/zpm
index 13f4c8e331b738112f0469598e4cfec7bd6c1e76..06599acaf4123844aaaea5a6cc9ded32086cd1d5 100755 (executable)
--- a/zpm
+++ b/zpm
@@ -1,5 +1,21 @@
 #!/bin/sh
 
+# parse command line options
+while getopts P: opt; do
+       case $opt in
+               P) PATH=$OPTARG:$PATH ;;
+               *) printf "zpm unknown option '%s'\n" "$opt"; exit 1 ;;
+       esac
+done
+shift $((OPTIND - 1))
+
+#: ${ZPMPATH:=/usr/libexec/zpm}
+
+if [ -n "$ZPMPATH" ]; then
+       PATH="$PATH:$ZPMPATH"
+fi
+export PATH
+
 [ -z "$1" ] && set help
 cmd="$1"
 shift
@@ -9,6 +25,12 @@ die() {
        exit 1;
 }
 
+# read in config files
+
+test -r /etc/zpmrc && . /etc/zpmrc
+test -r $HOME/.zpmrc && . $HOME/zpmrc
+test -r .zpmrc && . .zpmrc
+
 case $cmd in
        help)
                ecmd=$(command -v "zpm-$cmd") && { exec "$ecmd" "$@" || die "$0: unknown command zpm help"; }