#!/bin/sh


print -n "What is the offending command? "
read x
($x) > .tmp 2> .tmp2
(
  echo "Automatic bug report"
  echo "Offending command: $x"
  echo "System: `uname -a`"
  echo "Library version: `grep FULL_VERSION crunch.h`"
  echo
  echo
  echo "################# STDOUT #################"
  cat .tmp
  echo
  echo
  echo "################# STDERR #################"
  cat .tmp2
  echo
  echo
  echo "################ MAKEFILE ################"
  cat Makefile
) > mail.bug-report
\rm .tmp .tmp2
echo "Done bug report..."
echo "Now all you have to do is:"
echo "  mail -s \"Libcrunch bug report\" chatenad@cegramat.fr < mail.bug-report"
