mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-02-28 13:59:12 -05:00
fix cli options
This commit is contained in:
parent
cab1ad7d0a
commit
e97e43c90e
@ -10,12 +10,12 @@ LANG=en_US.UTF-8
|
|||||||
LANGUAGE=en_US.UTF-8
|
LANGUAGE=en_US.UTF-8
|
||||||
|
|
||||||
# handle opts
|
# handle opts
|
||||||
opts_spec=":dhvr:"
|
opts_spec=":dhv:r:i:"
|
||||||
opt_docs=false
|
opt_docs=false
|
||||||
opt_verbose=false
|
opt_verbose=false
|
||||||
|
|
||||||
usage () {
|
usage () {
|
||||||
echo "Usage: $0 [-d] [-h] [-v] [-r]"
|
echo "Usage: $0 [-d] [-h] [-v] [-r repoter] [-i interval]"
|
||||||
}
|
}
|
||||||
|
|
||||||
help () {
|
help () {
|
||||||
@ -37,6 +37,9 @@ while getopts "$opts_spec" opt; do
|
|||||||
r)
|
r)
|
||||||
REPORTER=$OPTARG
|
REPORTER=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
i)
|
||||||
|
INTERVAL=$OPTARG
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
init () {
|
init () {
|
||||||
if [ -z $FILE_LOCATION ]; then
|
if [ -z $FILE_LOCATION ]; then
|
||||||
echo "Missing configuration: \$FILE_LOCATION"
|
echo "Missing configuration: \$FILE_LOCATION"
|
||||||
return 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $FILE_LOCATION ]; then
|
if [ ! -f $FILE_LOCATION ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user