#!/bin/sh
LIBDIR=/usr/share/kernel-wedge/commands
usage () {
	echo "Usage: kernel-wedge command options"
	echo "Commands:"
	for file in $LIBDIR/*.txt; do
		echo -n "	"
		head -n 1 $file
	done
	exit 1
}
set -e
command=$1
if [ -z "$command" ]; then
	usage
fi
if [ ! -x "$LIBDIR/$command" ]; then
	usage
fi
shift 1 || true
$LIBDIR/$command "$@"
