diff options
author | Peter Palfrader <peter@palfrader.org> | 2012-08-14 09:18:35 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2012-08-14 09:18:35 +0000 |
commit | 7e64dc21f9050767942ec38500b33bf89f1f7c29 (patch) | |
tree | 4f3683ba61c56f04047552621a0e4ac4a56f2065 | |
parent | b3552ffd1f9c1544fa521382f4b4022be103278f (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-x | rvi | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |