#!/bin/sh

set -eu

short_options='B'
long_options='batch'

usage() {
  cat <<EOF
usage: debci shell [OPTIONS]

Options:
  -B, --batch               Run in non-interactive mode
                            (i.e. \`ruby\` instead of \`irb\`).

$@
EOF
}

. $debci_base_dir/lib/environment.sh

shell='irb'
while [ $# -gt 0 ]; do
  opt="$1"
  shift
  case "$opt" in
    -B|--batch)
      shell="ruby"
      ;;
    --)
      break
      ;;
  esac
done

"${shell}" -rdebci -r'debci/job' "$@"
