]> pd.if.org Git - zpackage/blobdiff - zpm
expand install
[zpackage] / zpm
diff --git a/zpm b/zpm
index 13f4c8e331b738112f0469598e4cfec7bd6c1e76..129c72ac5c5f717e19287fd1fc176936b09889d8 100755 (executable)
--- a/zpm
+++ b/zpm
@@ -1,5 +1,19 @@
 #!/bin/sh
 
+# parse command line options
+while getopts P: opt; do
+       case $opt in
+               P) PATH=$PATH:$OPTARG ;;
+               *) printf "zpm unknown option '%s'\n" "$opt"; exit 1 ;;
+       esac
+done
+shift $((OPTIND - 1))
+
+: ${ZPMPATH:=/usr/libexec/zpm}
+
+PATH="$PATH:$ZPMPATH"
+export PATH
+
 [ -z "$1" ] && set help
 cmd="$1"
 shift
@@ -9,6 +23,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"; }