Blame Scripts/Functions/Help/Texinfo/texinfo_getEntryIndex.sh

d286ed
#!/bin/bash
d286ed
#
d286ed
# texinfo_getEntryTitle.sh -- This function standardizes the way
d286ed
# values for chapter and section index definitions are printed out.
d286ed
#
d286ed
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
d286ed
#
d286ed
# This program is free software; you can redistribute it and/or modify
d286ed
# it under the terms of the GNU General Public License as published by
d286ed
# the Free Software Foundation; either version 2 of the License, or (at
d286ed
# your option) any later version.
d286ed
#
d286ed
# This program is distributed in the hope that it will be useful, but
d286ed
# WITHOUT ANY WARRANTY; without even the implied warranty of
d286ed
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
d286ed
# General Public License for more details.
d286ed
#
d286ed
# You should have received a copy of the GNU General Public License
d286ed
# along with this program; if not, write to the Free Software
d286ed
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
d286ed
#
d286ed
# ----------------------------------------------------------------------
d286ed
# $Id$
d286ed
# ----------------------------------------------------------------------
d286ed
d286ed
function texinfo_getEntryIndex {
d286ed
d286ed
    # Initialize phrase we want to transform based on style provided.
d286ed
    local PHRASE="$1"
d286ed
d286ed
    # In the entire phrase provided, capitalize the first word only.
d286ed
    PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \
d286ed
        | sed -r 's!^([[:alpha:]])!\u\1!')
d286ed
d286ed
    # Output transformed phrase.
d286ed
    echo "$PHRASE"
d286ed
d286ed
}
d286ed