summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2012-08-14 09:18:35 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2012-08-14 09:18:35 +0000
commit7e64dc21f9050767942ec38500b33bf89f1f7c29 (patch)
tree4f3683ba61c56f04047552621a0e4ac4a56f2065
parentb3552ffd1f9c1544fa521382f4b4022be103278f (diff)
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
-rwxr-xr-xrvi8
1 files changed, 8 insertions, 0 deletions
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 <file>" >&2
+ exit 1
+elif [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
+ echo "Usage: $0 <file>"
+ exit 0
+fi
+
if ! [ -e "$1" ] ; then
echo "$1 does not exist." >&2
exit 1