#!/bin/sh

PWD=`pwd`

[ x$1 = x--version ] && \
  echo `expr $PWD : ".*\/\(.*\)-[0-9\.]*"` `cat VERSION` && \
  grep "Copyright (C)" README && \
  cat << ! && exit

License: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
!

sed -ne "/^About$/,/^Download$/p" README \
    |tail -n+3 |head -n-3
echo
sed -ne "s/=*//; s/Examples/Examples:/; /^Examples:$/,/^Features$/p" README \
    |head -n-2
