diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-16 21:08:02 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-16 21:08:27 +1200 |
commit | 1e508ea0eaf10afe4b88fc15af288f2b4c285460 (patch) | |
tree | 45aaa3e2e0af75101eeef401e3ebbd0a1f0fc27b /bin/edda | |
parent | Remove crufty hash call from edda(1) (diff) | |
download | dotfiles-1e508ea0eaf10afe4b88fc15af288f2b4c285460.tar.gz dotfiles-1e508ea0eaf10afe4b88fc15af288f2b4c285460.zip |
Simplify help in edda(1) and eds(1)
Diffstat (limited to 'bin/edda')
-rwxr-xr-x | bin/edda | 21 |
1 files changed, 6 insertions, 15 deletions
@@ -4,25 +4,10 @@ # Give up completely if no BASH_VERSINFO (<2.0) [ -n "$BASH_VERSINFO" ] || exit -# Define usage function -usage() { - printf 'USAGE: %s [OPTS] [--] FILE1 [FILE2...]\n' "$self" -} - -# Need at least one file -if ! (($#)) ; then - usage >&2 - exit 1 -fi - # Parse options out, give help if necessary declare -a opts for arg ; do case $arg in - --help|-h|-\?) - usage - exit - ;; --) shift break @@ -34,6 +19,12 @@ for arg ; do esac done +# Need at least one file after options are parsed out +if ! (($#)) ; then + printf >&2 'edda: Need at least one file\n' + exit 2 +fi + # Duplicate stdin into a file, which we'll remove on exit stdin=$(mktemp -t "$self".XXXXXX) || exit cleanup() { |