aboutsummaryrefslogtreecommitdiff
path: root/bin/pre
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-08-13 10:58:10 -0300
committerEuAndreh <eu@euandre.org>2022-08-13 10:58:10 -0300
commita0188f38d8a9702dd3d7119375173d063a5f28bc (patch)
tree3ff6e25d0125cef5d7d7db0a7ace05a71d586166 /bin/pre
parentbin/httpno: Add working utility (diff)
downloaddotfiles-a0188f38d8a9702dd3d7119375173d063a5f28bc.tar.gz
dotfiles-a0188f38d8a9702dd3d7119375173d063a5f28bc.tar.xz
bin/: Replace usage of assert_arg with assert-arg
Diffstat (limited to 'bin/pre')
-rwxr-xr-xbin/pre10
1 files changed, 1 insertions, 9 deletions
diff --git a/bin/pre b/bin/pre
index 233ac1a..79c212f 100755
--- a/bin/pre
+++ b/bin/pre
@@ -52,16 +52,8 @@ while getopts 'c:h' flag; do
done
shift $((OPTIND - 1))
-assert_arg() {
- if [ -z "$1" ]; then
- printf 'Missing %s\n\n' "$2" >&2
- usage >&2
- exit 2
- fi
-}
-
PREFIX="${1:-}"
-assert_arg "$PREFIX" 'PREFIX'
+eval "$(assert-arg "$PREFIX" 'PREFIX')"
while read -r line; do
if [ -z "$COLOR" ]; then