summaryrefslogtreecommitdiff
path: root/bin/rcup
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rcup')
-rwxr-xr-xbin/rcup52
1 files changed, 7 insertions, 45 deletions
diff --git a/bin/rcup b/bin/rcup
index 4c3529d..c2e33dd 100755
--- a/bin/rcup
+++ b/bin/rcup
@@ -1,22 +1,10 @@
#!/bin/sh
-#set -x
+: ${RCM_LIB:=`dirname $0`/../share/rcm}
+. $RCM_LIB/rcm.sh
REPLACE_ALL=0
-DEST_DIR=$HOME
-DEBUG=:
-PRINT=echo
-PROMPT=echo_n
-VERBOSE=:
-MKDIR=mkdir
-LN=ln
-RM=rm
-
-echo_n() {
- printf "%s " "$*"
-}
-
link_file() {
local src=$1
local dest=$2
@@ -88,8 +76,9 @@ handle_command_line() {
arg_tags=""
verbosity=0
version=0
- dotfiles_dirs=
+ dotfiles_dirs=""
LS_ARGS=
+
while getopts Vqvt:d: opt; do
case "$opt" in
t)
@@ -107,44 +96,17 @@ handle_command_line() {
done
shift $(($OPTIND-1))
- if [ $version -eq 1 ]; then
- version rcup
- exit 0
- elif [ $verbosity -ge 2 ]; then
- DEBUG=echo
- VERBOSE=echo
- PRINT=echo
- elif [ $verbosity -eq 1 ]; then
- DEBUG=:
- VERBOSE=echo
- PRINT=echo
- elif [ $verbosity -eq 0 ]; then
- DEBUG=:
- VERBOSE=:
- PRINT=echo
- else
- DEBUG=:
- VERBOSE=:
- PRINT=:
- fi
-
- if [ "x$arg_tags" != "x" ]; then
- TAGS=$arg_tags
- fi
-
- if [ "x$dotfiles_dirs" != "x" ]; then
- DOTFILES_DIRS=$dotfiles_dirs
- fi
-
+ handle_common_flags rcup $version $verbosity
+ handle_metadata_flags $arg_tags $dotfiles_dirs
FILES=$@
LS_ARGS="$LS_ARGS $FILES"
+ $DEBUG "LS_ARGS: $LS_ARGS"
}
if [ -e $HOME/.rcrc ]; then
. $HOME/.rcrc
fi
-. `dirname $0`/../share/rcm/rcm.sh
handle_command_line $*
for dest_and_src in `lsrc $LS_ARGS`; do