Blame Scripts/Bash/Functions/Svg/svg.sh

641be4
#!/bin/bash
641be4
#
641be4
# svg.sh -- This function provides very basic SVG manipulations to
641be4
# help maintain svg files inside the repository.
641be4
#
7cd8e9
# Copyright (C) 2009, 2010 Alain Reguera Delgado
641be4
# 
7cd8e9
# This program is free software; you can redistribute it and/or
7cd8e9
# modify it under the terms of the GNU General Public License as
7cd8e9
# published by the Free Software Foundation; either version 2 of the
7cd8e9
# License, or (at your option) any later version.
641be4
# 
641be4
# This program is distributed in the hope that it will be useful, but
641be4
# WITHOUT ANY WARRANTY; without even the implied warranty of
641be4
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
641be4
# General Public License for more details.
641be4
#
641be4
# You should have received a copy of the GNU General Public License
641be4
# along with this program; if not, write to the Free Software
641be4
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
641be4
# USA.
641be4
# 
641be4
# ----------------------------------------------------------------------
641be4
# $Id$
641be4
# ----------------------------------------------------------------------
641be4
    
641be4
function svg {
641be4
641be4
    local FILES=''
641be4
641be4
    # Define list of scalable vector graphic files to process using
641be4
    # option value as reference.
641be4
    if [[ -d $OPTIONVAL ]];then
35298f
        FILES=$(find $OPTIONVAL -regextype posix-egrep -type f -regex "^${REGEX}\.svg$")
b6a56c
    elif [[ -f $OPTIONVAL ]];then
b6a56c
        FILES=$OPTIONVAL
641be4
    fi
35298f
35298f
    # Check list of files to process. If list of files is empty there
35298f
    # is nothing to do except to print a message and end script
35298f
    # execution.
35298f
    if [[ $FILES == '' ]];then
35298f
        cli_printMessage "`gettext "There is no file to process."`"
35298f
        cli_printMessage "$(caller)" 'AsToKnowMoreLine'
35298f
    fi
35298f
641be4
    # Define command line interface for svg-based actions.
35298f
    svg_getActions
641be4
641be4
}