summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGravatar Mike Burns <mike@mike-burns.com>2013-08-03 13:51:27 -0400
committerGravatar Mike Burns <mike@mike-burns.com>2013-08-03 13:51:27 -0400
commit4033e43d325e6ff6356eae7c899e593e4e644426 (patch)
tree42f115750649e8556524e7d05afbb162d72b9fd5 /bin
parent22b4bd5555fb8c56aa3137c19ec24704ddc3f64f (diff)
rcup -f and -i
Add the `-f` and `-i` options to rcup(1). `-f` will overwrite any file it doesn't recognize; `-i` will prompt each time, and is the default. For example: rm ~/.zshrc touch ~/.zshrc rcup -f # overwrite that .zshrc with the symlink rcup -i # prompt whether to overwrite that .zshrc
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rcup12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/rcup b/bin/rcup
index 9a0e82b..3aa5fa6 100755
--- a/bin/rcup
+++ b/bin/rcup
@@ -3,8 +3,6 @@
: ${RCM_LIB:=`dirname $0`/../share/rcm}
. $RCM_LIB/rcm.sh
-REPLACE_ALL=0
-
link_file() {
local src=$1
local dest=$2
@@ -78,12 +76,16 @@ handle_command_line() {
local version=0
local dotfiles_dirs=
local files=
+ REPLACE_ALL=0
+
- while getopts Vqvt:d: opt; do
+ while getopts Vqvfit:d: opt; do
case "$opt" in
+ f) REPLACE_ALL=1 ;;
+ i) REPLACE_ALL=0 ;;
t) arg_tags="$arg_tags $OPTARG" ;;
- v) verbosity=$(($verbosity + 1));;
- q) verbosity=$(($verbosity - 1));;
+ v) verbosity=$(($verbosity + 1)) ;;
+ q) verbosity=$(($verbosity - 1)) ;;
d) dotfiles_dirs="$dotfiles_dirs $OPTARG" ;;
V) version=1
esac