summaryrefslogtreecommitdiff
path: root/bin/rcup.in
diff options
context:
space:
mode:
authorGravatar Mike Burns <mike@mike-burns.com>2014-05-30 16:53:57 +0200
committerGravatar Mike Burns <mike@mike-burns.com>2014-07-09 11:10:04 +0200
commit82f59f31ceef20a262846fc1912de86b9d2df677 (patch)
tree1e1dc4154f767bc3cfa8fc18aee4aa3247cc88ed /bin/rcup.in
parentff2aa079062c7471c39590abf33d3f38b0c4abc7 (diff)
Allow the user to override SYMLINK_DIRS with -s
This adds a `-s` that can be used to override the `SYMLINK_DIRS` config, or the `-S` flag, to lsrc(1), mkrc(1), rcup(1), and rcdn(1). The `-s` flag is the opposite of -S: any argument, if it is a directory, is not symlinked but instead recurred down.
Diffstat (limited to 'bin/rcup.in')
-rwxr-xr-xbin/rcup.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/rcup.in b/bin/rcup.in
index 24d7177..1823099 100755
--- a/bin/rcup.in
+++ b/bin/rcup.in
@@ -104,10 +104,11 @@ handle_command_line() {
local includes=
local always_copy=0
local symlink_dirs=
+ local never_symlink_dirs=
local hostname=
REPLACE_ALL=0
- while getopts :CVqvfhikKI:x:S:t:d:B: opt; do
+ while getopts :CVqvfhikKI:x:S:s:t:d:B: opt; do
case "$opt" in
B) hostname="$OPTARG" ;;
C) always_copy=1 ;;
@@ -121,6 +122,7 @@ handle_command_line() {
q) verbosity=$(($verbosity - 1)) ;;
t) arg_tags="$arg_tags $OPTARG" ;;
S) symlink_dirs="$symlink_dirs $OPTARG";;
+ s) never_symlink_dirs="$never_symlink_dirs $OPTARG";;
v) verbosity=$(($verbosity + 1)) ;;
V) version=1 ;;
x) excludes="$excludes $OPTARG" ;;
@@ -157,6 +159,9 @@ handle_command_line() {
for symlink_dir in $symlink_dirs; do
LS_ARGS="$LS_ARGS -S $symlink_dir"
done
+ for never_symlink_dir in $never_symlink_dirs; do
+ LS_ARGS="$LS_ARGS -s $never_symlink_dir"
+ done
LS_ARGS="$LS_ARGS -B $hostname $files"
$DEBUG "LS_ARGS: $LS_ARGS"