aboutsummaryrefslogtreecommitdiff
path: root/bin/eds
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-16 21:08:02 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-16 21:08:27 +1200
commit1e508ea0eaf10afe4b88fc15af288f2b4c285460 (patch)
tree45aaa3e2e0af75101eeef401e3ebbd0a1f0fc27b /bin/eds
parentRemove crufty hash call from edda(1) (diff)
downloaddotfiles-1e508ea0eaf10afe4b88fc15af288f2b4c285460.tar.gz
dotfiles-1e508ea0eaf10afe4b88fc15af288f2b4c285460.zip
Simplify help in edda(1) and eds(1)
Diffstat (limited to 'bin/eds')
-rwxr-xr-xbin/eds20
1 files changed, 3 insertions, 17 deletions
diff --git a/bin/eds b/bin/eds
index eda00174..cf5c5e65 100755
--- a/bin/eds
+++ b/bin/eds
@@ -1,24 +1,13 @@
#!/usr/bin/env bash
# Create and edit executable scripts in a directory EDSPATH (defaults to ~/.local/bin)
-self=eds
# Give up completely if no BASH_VERSINFO (<2.0)
[ -n "$BASH_VERSINFO" ] || exit
-# Define a function to show usage
-usage() {
- printf 'USAGE: %s [EDITOR_OPTS] [--] FILE1 [FILE2...]\n' \
- "$self"
-}
-
# Process options, including detecting requests for help
declare -a opts
for arg ; do
case $arg in
- --help|-h|-\?)
- usage
- exit 0
- ;;
--)
shift
break
@@ -27,16 +16,13 @@ for arg ; do
shift
opts[${#opts[@]}]=$arg
;;
- *)
- break
- ;;
esac
done
-# If no arguments left, spit usage as an error and bail
+# Need at least one file after options are parsed out
if ! (($#)) ; then
- usage >&2
- exit 1
+ printf >&2 'eds: Need at least one script name\n'
+ exit 2
fi
# Create the script directory if it doesn't exist yet