diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2009-07-24 22:41:51 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-06-26 00:30:12 -0600 |
commit | dd78d7c7724e4da4b6f44f0483f0d28792c8f13c (patch) | |
tree | d842ab2fa09442b61684cf7e696c04beedd7db68 /src/rvs.sh | |
parent | 797494b91e13c6faf35affe5bbacb1a3d3aa13fe (diff) |
0.7.0 -- refactor to make core a pluggin (not done)
Diffstat (limited to 'src/rvs.sh')
-rw-r--r-- | src/rvs.sh | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -1,8 +1,6 @@ #!$$SHELL$$ -# abomination module:rvs name='rvs' -ver='0.6.3' -usage='COMMAND [OPTIONS]' +ver='0.7.0' # Copyright (C) 2009 Luke Shumaker # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -11,9 +9,13 @@ usage='COMMAND [OPTIONS]' # # Originally written by Luke Shumaker <lukeshu@sbcglobal.net>. -export RVSDIR='$$libdir$$' -source "$RVSDIR/lib/stdio" -#source "$RVSDIR/lib/rvsdb" +RVSDIR='$$libdir$$' +REPO=`$RVSDIR/repo` + +error() { + echo "$name: $1" >> /dev/stderr + exit 1 +} # START OPTION HANDLING # com=$1; @@ -22,8 +24,20 @@ case "$com" in '') error 'no command specified';; *) if [ -f "$RVSDIR/$com" ]; then + export RVSDIR $RVSDIR/$@ + done='yes' else + while read plugin; do + if [ -f "$RVSDIR/$plugin/$com" ]; then + export RVSDIR=$RVSDIR/$plugin + $RVSDIR/$@ + done='yes' + break + fi + done < $REPO/plugins + fi + if [ "$done" != 'yes' ]; then error "unrecognized command \`$com'" fi :;; |