# cache commands using bkt if installed
if command -v bkt >/dev/null 2>&1; then
  bkt() { command bkt "$@"; }
else
  # if bkt isnt installed skip its arguments and just execute directly.
  # optionally write a msg to stderr suggesting users install bkt.
  bkt() {
    # while [ "$1" = --* ]; do shift; done
    case "$1" in
      *)
        shift
        ;;
    esac
    "$@"
  }
fi

# now you can call bkt (the function) just like you'd call bkt (the binary):
bkt --ttl=1m -- expensive_cmd ...
