#!/usr/bin/env sh

if [ -x "$(command -v rg)" ]
then
  $EDITOR $(rg -l "$@")
  exit 0
fi

# shellcheck disable=SC2046
$EDITOR $(grep "$@")