From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1CB9F1387B1 for ; Tue, 19 Nov 2013 08:17:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3A6BEE09DD; Tue, 19 Nov 2013 08:17:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D1F74E09D7 for ; Tue, 19 Nov 2013 08:17:26 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E48AF33F2C5 for ; Tue, 19 Nov 2013 08:17:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 77D0DE54AB for ; Tue, 19 Nov 2013 08:17:23 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1384502491.ba92c398946c8608aaf8b0884d7ed2a7d2905586.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: libs/ X-VCS-Repository: proj/eselect X-VCS-Files: libs/output.bash.in X-VCS-Directories: libs/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: ba92c398946c8608aaf8b0884d7ed2a7d2905586 X-VCS-Branch: master Date: Tue, 19 Nov 2013 08:17:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bdb7a0f1-6f94-4bb2-9f72-675f5e581923 X-Archives-Hash: d6357054d51df05048b1a289cdb2fee2 commit: ba92c398946c8608aaf8b0884d7ed2a7d2905586 Author: Ulrich Müller gentoo org> AuthorDate: Thu Nov 14 23:56:22 2013 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Fri Nov 15 08:01:31 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=ba92c398 More cosmetic changes in output.bash. --- libs/output.bash.in | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libs/output.bash.in b/libs/output.bash.in index 78e0c4f..5390792 100644 --- a/libs/output.bash.in +++ b/libs/output.bash.in @@ -90,6 +90,7 @@ write_kv_list_entry() { local n text key val lindent rindent local left=${COLOUR_LIST_LEFT} right=${COLOUR_LIST_RIGHT} local normal=${COLOUR_NORMAL} + local cols=${COLUMNS:-80} local IFS=$' \t\n' if [[ $1 == "-p" ]]; then @@ -117,19 +118,15 @@ write_kv_list_entry() { n=$(( 28 + ${#rindent} )) fi - space ${n} - echo -n -e "${right}" + echo -n -e "$(space ${n})${right}" n=$(( 28 + ${#rindent} )) - local cols=${COLUMNS:-80} - local cwords=$(apply_text_highlights "${right}" "${val}") - text=${val//\%%%??%%%/} # only loop if it doesn't fit on the same line if [[ $(( ${n} + ${#text} )) -ge ${cols} ]]; then local i=0 spc="" rindent=$(space ${n}) - cwords=( ${cwords} ) + local cwords=( $(apply_text_highlights "${right}" "${val}") ) for text in ${val}; do text=${text//\%%%??%%%/} # put the word on the same line if it fits @@ -141,11 +138,11 @@ write_kv_list_entry() { echo -n -e "\n${rindent}${cwords[i]}" n=$(( ${#rindent} + ${#text} )) fi - i=$(( ${i} + 1 )) + (( i++ )) spc=" " done else - echo -n -e "${cwords}" + echo -n -e "$(apply_text_highlights "${right}" "${val}")" fi echo -e "${normal}" }