From 9103a858f09aa092003152acf19789f215993aba Mon Sep 17 00:00:00 2001 From: Alexis Lee Date: Fri, 19 Jun 2015 17:08:13 +0100 Subject: [PATCH] Support patterns containing spaces --- sack | 10 +++++----- sag | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sack b/sack index be9aae2..4b83f33 100755 --- a/sack +++ b/sack @@ -267,7 +267,7 @@ renameprofile() { } setflags() { - sack__new_flags=$@ + sack__new_flags="$@" # Read the current profile directly from the config file to avoid sync issues sack__current_profile_raw=$(cat $sack__config_path | grep -A 4 "# sack__beacon_tag_current_profile BEGIN") @@ -315,7 +315,7 @@ setflags() { } setdirectory() { - sack__new_directories=$@ + sack__new_directories="$@" # Validate the list of all directories passed in for sack__new_directory in $sack__new_directories @@ -491,13 +491,13 @@ elif [[ "$sack__option" == "-rp" || "$sack__option" == "--renameprofile" ]]; the # Set new preset flags for current profile elif [[ "$sack__option" == "-sf" || "$sack__option" == "--setflags" ]]; then shift - setflags $@ + setflags "$@" echo "" exit 0 # Set new preset search directory for current profile elif [[ "$sack__option" == "-sd" || "$sack__option" == "--setdirectory" ]]; then shift - setdirectory $@ + setdirectory "$@" echo "" exit 0 # Add a new profile @@ -540,7 +540,7 @@ echo "===> Searching parameters: $@" echo "" # The actual wrapper around ack -$sack__default_tool $sack__color_param $sack__flags $@ $sack__cwd | tee >$sack__dev_null >(display_shortcuts) >(process_shorcut_paths | remove_escaped_chars > $sack__shortcut_file) +$sack__default_tool $sack__color_param $sack__flags "$@" $sack__cwd | tee >$sack__dev_null >(display_shortcuts) >(process_shorcut_paths | remove_escaped_chars > $sack__shortcut_file) # Show usage instructions for first-time users; this can be turned off if [[ $sack__show_instructions -eq 0 ]]; then diff --git a/sag b/sag index ed36f19..cb3cee8 100755 --- a/sag +++ b/sag @@ -30,4 +30,4 @@ # ============================================================== # ============================================================== -sack -ag $@ +sack -ag "$@"