#!/bin/sh

if test "x${1}" = "x"; then
	echo "Usage: $0 <classname> [<package>]" >&2
	exit 1
fi

classname="${1}"
package="."

if test "x${2}" != "x"; then
  package="${2}"
fi

# TODO: skip directory-only matches
find . -name '*.h' -o -name '*.inl' -o -name '*.cpp' \
  | grep -wi "${classname}" \
  | grep -i "${package}"
