From a0188f38d8a9702dd3d7119375173d063a5f28bc Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 13 Aug 2022 10:58:10 -0300 Subject: bin/: Replace usage of assert_arg with assert-arg --- bin/grun | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'bin/grun') diff --git a/bin/grun b/bin/grun index cfd6b52..982420a 100755 --- a/bin/grun +++ b/bin/grun @@ -71,16 +71,8 @@ while getopts 'rh' flag; do done shift $((OPTIND - 1)) -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s\n\n' "$2" >&2 - usage >&2 - exit 2 - fi -} - FILENAME="${1:-}" -assert_arg "$FILENAME" 'FILENAME' +eval "$(assert-arg "$FILENAME" 'FILENAME')" shift if [ "${1:-}" != '--' ]; then @@ -90,7 +82,7 @@ if [ "${1:-}" != '--' ]; then fi shift -assert_arg "${1:-}" 'COMMAND' +eval "$(assert-arg "${1:-}" 'COMMAND')" if [ ! -e "$FILENAME" ]; then -- cgit v1.2.3