From 7e64dc21f9050767942ec38500b33bf89f1f7c29 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 14 Aug 2012 09:18:35 +0000 Subject: rvi: print usage with -h or --help, and with no arguments git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@543 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- rvi | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rvi') diff --git a/rvi b/rvi index c1f2d39..ac279fb 100755 --- a/rvi +++ b/rvi @@ -24,6 +24,14 @@ # wraper for rcs to edit files. Checks out a file, spawns an editor, and then # commits the file again. +if [ "$#" = 0 ]; then + echo "Usage: $0 " >&2 + exit 1 +elif [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + echo "Usage: $0 " + exit 0 +fi + if ! [ -e "$1" ] ; then echo "$1 does not exist." >&2 exit 1 -- cgit v1.2.3