|
|
878a2b |
#!/bin/bash
|
|
|
878a2b |
#
|
|
|
878a2b |
# render_getOptions.sh -- This function interprets option parameters
|
|
|
878a2b |
# passed to `render' functionality and calls actions accordingly.
|
|
|
878a2b |
#
|
|
|
03486a |
# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project
|
|
|
878a2b |
#
|
|
|
878a2b |
# This program is free software; you can redistribute it and/or modify
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
# General Public License for more details.
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
# along with this program; if not, write to the Free Software
|
|
|
878a2b |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
878a2b |
#
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
# $Id$
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
|
|
|
878a2b |
function render_getOptions {
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
local ARGSS=""
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
b730f1 |
local ARGSL="filter:,quiet,answer-yes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:,with-brands,commit-changes"
|
|
|
878a2b |
|
|
|
b730f1 |
|
|
|
878a2b |
cli_parseArguments
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
eval set -- "$ARGUMENTS"
|
|
|
878a2b |
|
|
|
878a2b |
# Look for options passed through command-line.
|
|
|
878a2b |
while true; do
|
|
|
878a2b |
|
|
|
878a2b |
case "$1" in
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
FLAG_FILTER="$2"
|
|
|
878a2b |
shift 2
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
FLAG_QUIET="true"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
--answer-yes )
|
|
|
878a2b |
FLAG_ANSWER="true"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
FLAG_DONT_DIRSPECIFIC="true"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
FLAG_POSTRENDITION="$2"
|
|
|
878a2b |
shift 2
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
FLAG_LASTRENDITION="$2"
|
|
|
878a2b |
shift 2
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
FLAG_BASEARCH="$2"
|
|
|
878a2b |
if [[ ! $FLAG_BASEARCH =~ $(cli_getPathComponent --architecture-pattern) ]];then
|
|
|
878a2b |
cli_printMessage "`gettext "The architecture provided is not supported."`" --as-error-line
|
|
|
878a2b |
fi
|
|
|
878a2b |
shift 2
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
FLAG_RELEASEVER="$2"
|
|
|
878a2b |
if [[ ! $FLAG_RELEASEVER =~ $(cli_getPathComponent --release-pattern) ]];then
|
|
|
878a2b |
cli_printMessage "`gettext "The release version provided is not supported."`"
|
|
|
878a2b |
fi
|
|
|
878a2b |
shift 2
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
FLAG_THEME_MODEL=$(cli_getRepoName $2 -d)
|
|
|
878a2b |
shift 2
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
--with-brands )
|
|
|
878a2b |
FLAG_WITH_BRANDS='true'
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
b730f1 |
|
|
|
b730f1 |
FLAG_COMMIT_CHANGES='true'
|
|
|
b730f1 |
shift 1
|
|
|
b730f1 |
|
|
|
b730f1 |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
# in order for processing non-option arguments
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
break
|
|
|
878a2b |
|
|
|
878a2b |
esac
|
|
|
878a2b |
done
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
cli_parseArgumentsReDef "$@"
|
|
|
878a2b |
|
|
|
878a2b |
}
|