Skip to content

Commit

Permalink
Revise 'search' Command to Use Multiple Arguments (#255)
Browse files Browse the repository at this point in the history
* This places quotations around input argument to allow for multiple arguments
to be used when searching.
* A string can be inserted using quotations after the search commands.
    * Example: `search "foo bar"` will search for the entire string
* Additional arguments can be added.
    * Example: `search "foo bar" directory/` will search for the entire string
    in the specific subdirectory.
  • Loading branch information
corbinhesse authored and holman committed Oct 10, 2016
1 parent ba41c7d commit 3e72c81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/search
@@ -1,12 +1,12 @@
#!/bin/sh
#
# Quick search in a directory for a string ($1).
# Quick search in a directory for a string ($@).
#
set -e

# use -iru to search directories ack usually ignores (like .git)
if [ -x /usr/bin/ack-grep ]; then
ack-grep -i $1
ack-grep -i "$@"
else
ack -i $1
ack -i "$@"
fi

0 comments on commit 3e72c81

Please sign in to comment.