>>>>> On Sat, 16 Apr 2022, Sam James wrote:

> +# @FUNCTION: edo

Just a remark: A similar command existed a long time ago under the
name "try". [1]

It was executed under "env" [2], should we also do that?

> +# @USAGE: command [arg1 [arg2 ...]]

<command> should be in angle brackets, if we follow the usual
convention. Maybe even "<command> [arg]..."

> +# @DESCRIPTION:
> +# Executes 'command' with any given arguments and exits on failure unless
> +# called under 'nonfatal'.
> +edo() {
> +     elog "$@"
> +     "$@" || die -n "Failed to run command: $@ failed"
> +}

Maybe add an ebegin/eend variant?

edobe() {
    ebegin "Running $@"
    "$@"
    eend $? || die -n "$@ failed"
    return $?
}

Ulrich

[1] 
https://gitweb.gentoo.org/archive/proj/portage-cvs.git/tree/bin/ebuild.sh?id=b7c9c02ee04ae62068f8db775c1189fd796cd797#n85
[2] 
https://gitweb.gentoo.org/archive/repo/gentoo-2.git/commit/?id=e5168d05cad140ecd7e966bce3f771003e6d392b

Attachment: signature.asc
Description: PGP signature

Reply via email to