[arch-general] [PATCH 05/48] a little creative parameter expansion simplifies stat_die()

Thomas Bächler thomas at archlinux.org
Wed Jun 30 17:57:15 EDT 2010


Nice patch, but ...

> -if [ -t 1 ]; then
> +if [[ -t 1 ]]; then
>  	SAVE_POSITION="\033[s"
>  	RESTORE_POSITION="\033[u"
>  	DEL_TEXT="\033[$(($STAT_COL+4))G"
> @@ -116,10 +116,8 @@ stat_fail() {

Hmm, this definitely doesn't belong into this patch.

>  }
>  
>  stat_die() {
> -	retval=1
> -	[ "$1" = "" ] || retval=$1
>  	stat_fail
> -	exit $retval
> +	exit ${1:-1}
>  }
>  
>  status() {

Okay, this is certainly nicer than before.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-general/attachments/20100630/75f4b605/attachment.bin>


More information about the arch-general mailing list