#! /bin/sh
set -e

error()
{
    echo >&2 "ERROR: `basename $0`: $*"
    exit 1
}

PRJ=`prcsguess`
LIST=$PRJ.move

prcs populate -n -d --plain-format -q "$@" |
    grep -vE 'prcs: (.* is unavailable.  Delete.|Ignoring file)' |
    sed -e 's/^prcs: Added \(.*\) of type \(.*\)$/ADDED	\1	\2/' \
        -e 's/^prcs: Deleted \(.*\) of type \(.*\)$/\1	DELETED	\2/'
