diff options
author | Mike Burns <mike@mike-burns.com> | 2013-08-03 12:23:08 -0400 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2013-08-03 12:23:08 -0400 |
commit | 5ebd40d8ab1d4806924476a3853edb101ca0a6ff (patch) | |
tree | c9449ad44edc4d95b0013b2eb0569b1b250ab6d8 /bin/lsrc | |
parent | 9e16a4aea0dad1909abc78b3f9bc1291917486db (diff) |
Bugfix: support -t and -d again
Due to the awesome refactoring in
fe3244ca9c8c9a38ea700851e36667b1015d11e6, the `-t` and `-d` options were
broken. Fix it by removing the `handle_metadata_flags` function and
inlining the code again, and build the `LS_ARGS` argument differently.
Clearly I need a test suite.
Diffstat (limited to 'bin/lsrc')
-rwxr-xr-x | bin/lsrc | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -82,10 +82,10 @@ metafile() { } handle_command_line() { - arg_tags="" - verbosity=0 - version=0 - dotfiles_dirs="" + local arg_tags= + local verbosity=0 + local version=0 + local dotfiles_dirs= while getopts Vqvt:d: opt; do case "$opt" in @@ -99,8 +99,12 @@ handle_command_line() { shift $(($OPTIND-1)) handle_common_flags lsrc $version $verbosity - handle_metadata_flags $arg_tags $dotfiles_dirs + TAGS=${arg_tags:-$TAGS} + DOTFILES_DIRS=${dotfiles_dirs:-$DOTFILES_DIRS} FILES=$@ + + $DEBUG "TAGS: $TAGS" + $DEBUG "DOTFILES_DIRS: $DOTFILES_DIRS" } DEST_STACK= @@ -111,9 +115,8 @@ fi handle_command_line $* -if [ "x$DOTFILES_DIRS" = "x" ]; then - DOTFILES_DIRS="$DOTFILES_DIRS $DEFAULT_DOTFILES_DIR" -fi +: ${DOTFILES_DIRS:=$DOTFILES_DIRS $DEFAULT_DOTFILES_DIR} +$DEBUG "DOTFILES_DIRS: $DOTFILES_DIRS" for DOTFILES_DIR in $DOTFILES_DIRS; do |