#!/bin/sh

IOPT='-i'

print_note()
{
	echo ""
	echo "Note that it is NOT real datefudge program, it is just"
	echo "a wrapper for faketime."
}

usage()
{
	echo "Usage: ${0##*/} [-s|--static] date program args..."
	echo ""
	echo "Run 'program' with 'args'."
	echo "The program will believe that the current time is 'date'."
	print_note

	exit $1
}

case "$1" in
	--static|-s)
		shift
		IOPT=
		;;
	--help|-h|-\?)
		usage 0
		;;
	--version|-v)
		echo "${0##*/}: Version 0.3"
		print_note
		exit 0
		;;
	''|-*)
		usage 1
		;;
esac

DVAL="$1"; shift

exec faketime $IOPT -d "$DVAL" -- "$@"
