#!/bin/sh

set -eu

usage() {
    printf %s "\
  $(basename "$0") [command]
    watch current filesystem tree for changes & run [command] when changes detected.

  examples:
    TEST_CONFIG='xyz' $(basename "$0") pytest
    $(basename "$0") make test
"
  exit 0
}

[ "$#" -eq 0 ] && usage

rg --files-with-matches | entr "$*"
