From 82f59f31ceef20a262846fc1912de86b9d2df677 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Fri, 30 May 2014 16:53:57 +0200 Subject: 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. --- bin/rcdn.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin/rcdn.in') 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" -- cgit v1.2.3