Blame Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh

17230b
#!/bin/bash
17230b
#
17230b
# prepare_seeEnvironment.sh -- This function outputs a brief description of
17230b
# relevant environment variables used by `centos-art.sh' script.
17230b
#
e6bbbf
# Copyright (C) 2009-2013 The CentOS Project
17230b
#
17230b
# This program is free software; you can redistribute it and/or modify
17230b
# it under the terms of the GNU General Public License as published by
17230b
# the Free Software Foundation; either version 2 of the License, or (at
17230b
# your option) any later version.
17230b
#
17230b
# This program is distributed in the hope that it will be useful, but
17230b
# WITHOUT ANY WARRANTY; without even the implied warranty of
17230b
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17230b
# General Public License for more details.
17230b
#
17230b
# You should have received a copy of the GNU General Public License
17230b
# along with this program; if not, write to the Free Software
17230b
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17230b
#
17230b
# ----------------------------------------------------------------------
74a868
# $Id$
17230b
# ----------------------------------------------------------------------
17230b
17230b
function prepare_seeEnvironment {
17230b
17230b
    local -a VARS
17230b
    local -a INFO
17230b
    local COUNT=0
17230b
17230b
    # Define name of environment variables used by centos-art.sh
17230b
    # script.
17230b
    VARS[0]='EDITOR'
17230b
    VARS[1]='TZ'
17230b
    VARS[2]='TEXTDOMAIN'
17230b
    VARS[3]='TEXTDOMAINDIR'
17230b
    VARS[4]='LANG'
17230b
    VARS[5]='TCAR_WORKDIR'
17230b
17230b
    # Define description of environment variables.
17230b
    INFO[0]="`gettext "Default text editor"`"
17230b
    INFO[1]="`gettext "Default time zone representation"`"
17230b
    INFO[2]="`gettext "Default domain used to retrieve translated messages"`"
17230b
    INFO[3]="`gettext "Default directory used to retrive translated messages"`"
17230b
    INFO[4]="`gettext "Default locale information"`"
17230b
    INFO[5]="`gettext "Default path to your working copy"`"
17230b
17230b
    until [[ $COUNT -eq ${#VARS[*]} ]];do
17230b
17230b
        # Let user to reduce output using regular expression as
17230b
        # reference.
17230b
        if [[ ${VARS[$COUNT]} =~ $FLAG_FILTER ]];then
17230b
17230b
            # Output list of environment variables using indirect
17230b
            # expansion (what a beautiful feature!) to output variable
17230b
            # value.
17230b
            cli_printMessage "${INFO[$COUNT]}:"
17230b
            cli_printMessage "${VARS[$COUNT]}=${!VARS[$COUNT]}" --as-response-line
17230b
17230b
        fi
17230b
17230b
        # Increment counter.
17230b
        COUNT=$(($COUNT + 1))
17230b
17230b
    done
17230b
17230b
}