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 DFBEF138247 for ; Thu, 14 Nov 2013 23:56:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 08BC4E0B25; Thu, 14 Nov 2013 23:56:41 +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 7A928E0B25 for ; Thu, 14 Nov 2013 23:56:40 +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 6EDD233F153 for ; Thu, 14 Nov 2013 23:56:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 262A2E530A for ; Thu, 14 Nov 2013 23:56:38 +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: <1384473382.c63f4fd00866485ee8c7ab95ab17733cc25aaba9.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:nolinewrap 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: c63f4fd00866485ee8c7ab95ab17733cc25aaba9 X-VCS-Branch: nolinewrap Date: Thu, 14 Nov 2013 23:56:38 +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: 6300686c-16d7-4080-89bf-1780cb7e8e7d X-Archives-Hash: b3578ae8bcbb5126f8799cd42fa8f9b4 commit: c63f4fd00866485ee8c7ab95ab17733cc25aaba9 Author: Ulrich Müller gentoo org> AuthorDate: Thu Nov 14 23:56:22 2013 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Thu Nov 14 23:56:22 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=c63f4fd0 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}" }