#!/bin/bash

# See ./reg-test/run and ./reg-test/README.md for background on this
# keystroke-saver.
for arg; do
  for suffix in out err; do
    src=output-reg-test/$arg.$suffix
    if [ -f $src ]; then
      cp $src reg-test/expected
    elif [ -f $arg ]; then
      src=output-reg-test/$(basename $arg).$suffix
      cp $src reg-test/expected
    else
      echo "Cannot find source $arg" 1>&2
      exit 1
    fi
  done
done
