|
|
878a2b |
#!/bin/bash
|
|
|
878a2b |
#
|
|
|
878a2b |
# locale_getOptions.sh -- This function interprets option parameters
|
|
|
878a2b |
# passed to `locale' functionality and defines action names
|
|
|
878a2b |
# accordingly.
|
|
|
878a2b |
#
|
|
|
e6bbbf |
# Copyright (C) 2009-2013 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 locale_getOptions {
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
3b9515 |
local ARGSS="h,q"
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
3b9515 |
local ARGSL="help,quiet,filter:,answer-yes,update,edit,delete,dont-create-mo,is-localizable,synchronize"
|
|
|
878a2b |
|
|
|
3431b3 |
|
|
|
878a2b |
cli_parseArguments
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
eval set -- "${ARGUMENTS}"
|
|
|
878a2b |
|
|
|
878a2b |
# Look for options passed through command-line.
|
|
|
878a2b |
while true; do
|
|
|
878a2b |
case "$1" in
|
|
|
878a2b |
|
|
|
3b9515 |
-h | --help )
|
|
|
3b9515 |
cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-locale"
|
|
|
3b9515 |
shift 1
|
|
|
3b9515 |
exit
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
04d83d |
-q |
|
|
|
04d83d |
FLAG_QUIET="true"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
3b9515 |
|
|
|
3b9515 |
FLAG_FILTER="$2"
|
|
|
3b9515 |
shift 2
|
|
|
3b9515 |
|
|
|
3b9515 |
|
|
|
878a2b |
--answer-yes )
|
|
|
878a2b |
FLAG_ANSWER="true"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
ACTIONNAMS="$ACTIONNAMS locale_updateMessages"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
ACTIONNAMS="$ACTIONNAMS locale_editMessages"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
--delete )
|
|
|
878a2b |
ACTIONNAMS="$ACTIONNAMS locale_deleteMessages"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
cdce34 |
--is-localizable )
|
|
|
cdce34 |
ACTIONNAMS="$ACTIONNAMS locale_isLocalizable"
|
|
|
cdce34 |
shift 1
|
|
|
cdce34 |
|
|
|
cdce34 |
|
|
|
3431b3 |
|
|
|
3431b3 |
FLAG_DONT_CREATE_MO="true"
|
|
|
781b69 |
shift 1
|
|
|
781b69 |
|
|
|
781b69 |
|
|
|
3b9515 |
|
|
|
3b9515 |
FLAG_SYNCHRONIZE="true"
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
# in order for processing non-option arguments
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
25c9bc |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
shift 1
|
|
|
878a2b |
break
|
|
|
878a2b |
|
|
|
878a2b |
esac
|
|
|
878a2b |
done
|
|
|
878a2b |
|
|
|
706a5b |
|
|
|
706a5b |
|
|
|
878a2b |
if [[ $ACTIONNAMS == '' ]];then
|
|
|
706a5b |
cli_printMessage "`gettext "You need to provide one action at least."`" --as-error-line
|
|
|
878a2b |
fi
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
cli_parseArgumentsReDef "$@"
|
|
|
878a2b |
|
|
|
878a2b |
}
|