Blame Scripts/Functions/Tuneup/tuneup_getOptions.sh
|
|
66b51c |
#!/bin/bash
|
|
|
66b51c |
#
|
|
|
1bd8df |
# tuneup_getOptions.sh -- This function interprets option parameters
|
|
|
1bd8df |
# passed to `tuneup' functionality and calls actions accordingly.
|
|
|
66b51c |
#
|
|
|
2fe9b7 |
# Copyright (C) 2009, 2010, 2011 The CentOS Project
|
|
|
fa95b1 |
#
|
|
|
fa95b1 |
# This program is free software; you can redistribute it and/or modify
|
|
|
fa95b1 |
|
|
|
dcd347 |
|
|
|
dcd347 |
|
|
|
fa95b1 |
#
|
|
|
74a058 |
|
|
|
74a058 |
|
|
|
66b51c |
|
|
|
66b51c |
# General Public License for more details.
|
|
|
66b51c |
#
|
|
|
66b51c |
|
|
|
66b51c |
# along with this program; if not, write to the Free Software
|
|
|
dcd347 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
7ac5a5 |
#
|
|
|
66b51c |
# ----------------------------------------------------------------------
|
|
|
66b51c |
# $Id$
|
|
|
66b51c |
# ----------------------------------------------------------------------
|
|
|
66b51c |
|
|
|
1bd8df |
function tuneup_getOptions {
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
local ARGSS=""
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
3ccb0a |
local ARGSL="filter:,quiet,answer-yes,dont-commit-changes"
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
793c4c |
cli_parseArguments
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
eval set -- "$ARGUMENTS"
|
|
|
66b51c |
|
|
|
66b51c |
# Look for options passed through command-line.
|
|
|
66b51c |
while true; do
|
|
|
66b51c |
|
|
|
66b51c |
case "$1" in
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
FLAG_FILTER="$2"
|
|
|
66b51c |
shift 2
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
FLAG_QUIET="true"
|
|
|
66b51c |
FLAG_DONT_COMMIT_CHANGES="true"
|
|
|
66b51c |
shift 1
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
3ccb0a |
--answer-yes )
|
|
|
3ccb0a |
FLAG_ANSWER="true"
|
|
|
3ccb0a |
shift 1
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
FLAG_DONT_COMMIT_CHANGES="true"
|
|
|
66b51c |
shift 1
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
# in order for processing non-option arguments
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
66b51c |
shift 1
|
|
|
66b51c |
break
|
|
|
66b51c |
|
|
|
66b51c |
esac
|
|
|
66b51c |
done
|
|
|
66b51c |
|
|
|
66b51c |
|
|
|
793c4c |
cli_parseArgumentsReDef "$@"
|
|
|
66b51c |
|
|
|
1858f4 |
# Verify non-option arguments passed to command-line. If there
|
|
|
1858f4 |
|
|
|
1858f4 |
|
|
|
1858f4 |
if [[ $ARGUMENTS == '' ]];then
|
|
|
1858f4 |
ARGUMENTS=${PWD}
|
|
|
1858f4 |
fi
|
|
|
1858f4 |
|
|
|
66b51c |
}
|