From: Ray Strode Date: Wed, 19 Nov 2008 15:40:40 +0000 (-0500) Subject: Add usage info to plymouth-set-default-plugin X-Git-Tag: 0.6.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02ea84e6d3979f220ae319679a55a707ae3ce5b6;p=thirdparty%2Fplymouth.git Add usage info to plymouth-set-default-plugin --- diff --git a/scripts/plymouth-set-default-plugin.in b/scripts/plymouth-set-default-plugin.in index 473221b3..224c58ff 100755 --- a/scripts/plymouth-set-default-plugin.in +++ b/scripts/plymouth-set-default-plugin.in @@ -14,6 +14,11 @@ fi [ -z "$LIBDIR" ] && LIBDIR="/usr/$LIB" [ -z "$BINDIR" ] && BINDIR="/usr/bin" +function usage () +{ + echo "usage: plymouth-set-default-plugin { --reset | }" +} + if [ $# -lt 1 ]; then PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so) if [ -z "$PLUGIN_NAME" ]; then @@ -29,6 +34,11 @@ if [ `id -u` -ne 0 ]; then exit 1 fi +if [ $# -ne 1 ]; then + echo $(usage) > /dev/stderr + exit 1 +fi + PLUGIN_NAME=$1 if [ $1 = '--reset' ]; then PLUGIN_NAME=$(basename $(ls -1 -t ${LIBDIR}/plymouth/*.so 2> /dev/null | grep -v default.so | tail -n 1) .so)