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 4D860138247 for ; Sun, 10 Nov 2013 20:24:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 37AC9E0B21; Sun, 10 Nov 2013 20:24:24 +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 9F9B6E0B01 for ; Sun, 10 Nov 2013 20:24:23 +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 4D99533DAA9 for ; Sun, 10 Nov 2013 20:24:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id E9CC7E530A for ; Sun, 10 Nov 2013 20:24:20 +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: <1384106794.3b1430f118e4c696c4588f30b5b52cc6cbac76a6.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: 3b1430f118e4c696c4588f30b5b52cc6cbac76a6 X-VCS-Branch: master Date: Sun, 10 Nov 2013 20:24:20 +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: 96659388-37f2-447f-822d-91074d8029cc X-Archives-Hash: 2d72ba57b17b866cdd2c948d0cefec4d commit: 3b1430f118e4c696c4588f30b5b52cc6cbac76a6 Author: Ulrich Müller gentoo org> AuthorDate: Sun Nov 10 18:06:34 2013 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sun Nov 10 18:06:34 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=3b1430f1 Cosmetic changes in output.bash. --- libs/output.bash.in | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libs/output.bash.in b/libs/output.bash.in index 5c79c53..ac934bb 100644 --- a/libs/output.bash.in +++ b/libs/output.bash.in @@ -40,13 +40,13 @@ colours() { # set output mode to $1 set_output_mode() { - ESELECT_OUTPUT_MODE=${1} + ESELECT_OUTPUT_MODE=$1 } # is_output_mode PUBLIC # test if $1 is the current output mode is_output_mode() { - [[ ${ESELECT_OUTPUT_MODE} = ${1} ]] + [[ ${ESELECT_OUTPUT_MODE} = $1 ]] } # Determine width of terminal and set COLUMNS variable @@ -72,7 +72,7 @@ write_warning_msg() { write_list_start() { is_output_mode brief && return local colour=${COLOUR_LIST_HEADER} normal=${COLOUR_NORMAL} - if [[ ${1} == "-p" ]] ; then + if [[ $1 == "-p" ]]; then colour=; normal= shift fi @@ -92,7 +92,7 @@ write_kv_list_entry() { local normal=${COLOUR_NORMAL} local IFS=$' \t\n' - if [[ ${1} == "-p" ]] ; then + if [[ $1 == "-p" ]]; then left=; right=; normal= shift fi @@ -112,7 +112,7 @@ write_kv_list_entry() { # if ${n} is less than or equal to zero then we have a long ${key} # that will mess up the formatting of ${val}, so end the line, indent # and let ${val} go on the next line. - if [[ ${n} -le 0 ]] ; then + if [[ ${n} -le 0 ]]; then echo n=$(( 28 + ${#rindent} )) fi @@ -126,14 +126,14 @@ write_kv_list_entry() { text=${val//\%%%??%%%/} # only loop if it doesn't fit on the same line - if [[ $(( ${n} + ${#text} )) -ge ${cols} ]] ; then + if [[ $(( ${n} + ${#text} )) -ge ${cols} ]]; then local i=0 spc="" rindent=$(space ${n}) cwords=( ${cwords} ) - for text in ${val} ; do + for text in ${val}; do text=${text//\%%%??%%%/} # put the word on the same line if it fits - if [[ $(( ${n} + ${#spc} + ${#text} )) -lt ${cols} ]] ; then + if [[ $(( ${n} + ${#spc} + ${#text} )) -lt ${cols} ]]; then echo -n -e "${spc}${cwords[i]}" n=$(( ${n} + ${#spc} + ${#text} )) # otherwise, start a new line and indent @@ -157,7 +157,7 @@ write_numbered_list_entry() { local left=${COLOUR_LIST_LEFT} right=${COLOUR_LIST_RIGHT} local normal=${COLOUR_NORMAL} - if [[ ${1} == "-p" ]] ; then + if [[ $1 == "-p" ]]; then left=; right=; normal= shift fi @@ -192,11 +192,11 @@ write_numbered_list() { write_kv_list_entry ${p} "${m}" "" fi - while [[ $# -gt 0 ]] ; do - item=${1} + while [[ $# -gt 0 ]]; do + item=$1 shift - if [[ ${item##*\\} == "" ]] ; then - item="${item%\\} ${1}" + if [[ ${item##*\\} == "" ]]; then + item="${item%\\} $1" shift fi write_numbered_list_entry ${p} "${n}" "${item}" @@ -208,7 +208,7 @@ write_numbered_list() { # Apply text highlights. First arg is the 'restore' colour, second arg # is the text. apply_text_highlights() { - local restore=${1:-${COLOUR_NORMAL}} text=${2} + local restore=${1:-${COLOUR_NORMAL}} text=$2 text="${text//?%%HI%%%/${COLOUR_HI}}" text="${text//?%%WA%%%/${COLOUR_WARN}}" text="${text//?%%RE%%%/${restore}}" @@ -231,7 +231,7 @@ highlight_warning() { # Mark list entry $1 as active/selected by placing a highlighted star # (or $2 if set) behind it. highlight_marker() { - local text=${1} mark=${2-*} + local text=$1 mark=${2-*} echo -n "${text}" if [[ -n ${mark} ]] && ! is_output_mode brief; then echo -n " " @@ -243,7 +243,7 @@ highlight_marker() { # Write $1 numbers of spaces space() { local n ret="" - for (( n = 1 ; n <= ${1} ; ++n )) ; do + for (( n = 1; n <= $1; ++n )); do ret="${ret} " done echo -n "${ret}"