fish/functions/ag.fish @ 3d37ca22c5c5 bpollack/use-command-to-explicitly-call-ag-and-us-1442506830050

Use command to explicitly call ag, and use compound if block
author Benjamin Pollack <benjamin@bitquabit.com>
date Thu, 17 Sep 2015 16:20:42 +0000
parents 4fae0d361139
children 0d6656688318
function ag -d "Run Ag with appropriate options."
    if begin test -f '.agignore'; and grep -q 'pragma: skipvcs' '.agignore'; end
        # If .agignore contains pragma: skipvcs, then we'll run ag in
        # "disregard .gitignore/.hgignore/svn:ignore" mode.  This lets us
        # still search in files the VCS has ignored.
        command ag --search-files -U $argv
    else
        command ag --search-files $argv
    end
end