summaryrefslogtreecommitdiff
path: root/bin/rcdn.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/rcdn.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/rcdn.in')
-rwxr-xr-xbin/rcdn.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/rcdn.in b/bin/rcdn.in
index 1179b97..e5cb119 100755
--- a/bin/rcdn.in
+++ b/bin/rcdn.in
@@ -37,9 +37,10 @@ handle_command_line() {
local excludes=
local includes=
local symlink_dirs=
+ local never_symlink_dirs=
local hostname=
- while getopts :VqvhI:x:S:t:d:B: opt; do
+ while getopts :VqvhI:x:S:s:t:d:B: opt; do
case "$opt" in
h) show_help ;;
B) hostname="$OPTARG" ;;
@@ -48,6 +49,7 @@ handle_command_line() {
K) run_hooks=0 ;;
t) arg_tags="$arg_tags $OPTARG" ;;
S) symlink_dirs="$symlink_dirs $OPTARG";;
+ s) never_symlink_dirs="$never_symlink_dirs $OPTARG";;
v) verbosity=$(($verbosity + 1));;
q) verbosity=$(($verbosity - 1));;
d) dotfiles_dirs="$dotfiles_dirs $OPTARG" ;;
@@ -81,6 +83,9 @@ handle_command_line() {
for symlink_dir in $symlink_dirs; do
LS_ARGS="$LS_ARGS -S $symlink_dir"
done
+ for never_symlink_dir in $symlink_dirs; do
+ LS_ARGS="$LS_ARGS -s $never_symlink_dir"
+ done
LS_ARGS="$LS_ARGS -B $hostname $files"
$DEBUG "LS_ARGS: $LS_ARGS"