Files
2026-06-23 00:23:16 +02:00

19 lines
399 B
Fish

function search
if test (count $argv) -lt 1
echo "Usage: search <string> [directory]"
return 1
end
if not command -q rg
echo "search: 'rg' (ripgrep) is not installed. Install it via your package manager."
return 1
end
set query $argv[1]
set dir "."
if test (count $argv) -ge 2
set dir $argv[2]
end
rg "$query" "$dir"
end