summaryrefslogtreecommitdiff
path: root/bin/rcup
diff options
context:
space:
mode:
authorGravatar Mike Burns <mike@mike-burns.com>2013-08-04 10:35:14 -0400
committerGravatar Mike Burns <mike@mike-burns.com>2013-08-05 04:21:21 +0200
commit63b50643b0ffd287d0070e494625056a05081ce8 (patch)
tree0ee843065deed78edf646f11f8d46ff28c6964ba /bin/rcup
parent17c803d03d20f84cb37873e05d1539dbe7d43a77 (diff)
Introduce exclusion patterns
The lsrc(1), rcup(1), and rcdn(1) commands now take any number of `-e` flags, used to specify an exclusion pattern. This can also be controlled via rcrc(5), the `EXCLUDES` variable. An exclusion pattern specifies a file glob to skip. In the case of lsrc(1), any file matching the glob is not listed; in rcup(1) it is not symlinked; and in rcdn(1) it is not removed. The file glob can be preceded by the name of a dotfiles directory (separated from the file glob by a colon) to increase the specificity. Useful for: rcdn -e rcrc rcup -d work-dotfiles -e bashrc rcup -d ~/.dotfiles -d wife-dotfiles -d sys-dotfiles -e wife-dotfiles:tigrc
Diffstat (limited to 'bin/rcup')
-rwxr-xr-xbin/rcup7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/rcup b/bin/rcup
index 3aa5fa6..7c1cf16 100755
--- a/bin/rcup
+++ b/bin/rcup
@@ -76,11 +76,13 @@ handle_command_line() {
local version=0
local dotfiles_dirs=
local files=
+ local excludes=
REPLACE_ALL=0
- while getopts Vqvfit:d: opt; do
+ while getopts Vqvfie:t:d: opt; do
case "$opt" in
+ e) excludes="$excludes $OPTARG";;
f) REPLACE_ALL=1 ;;
i) REPLACE_ALL=0 ;;
t) arg_tags="$arg_tags $OPTARG" ;;
@@ -104,6 +106,9 @@ handle_command_line() {
for dotfiles_dir in $dotfiles_dirs; do
LS_ARGS="$LS_ARGS -d $dotfiles_dir"
done
+ for exclude in $excludes; do
+ LS_ARGS="$LS_ARGS -e $exclude"
+ done
LS_ARGS="$LS_ARGS $files"
$DEBUG "LS_ARGS: $LS_ARGS"