mirror of
https://github.com/Zygo/bees.git
synced 2025-08-02 13:53:28 +02:00
Compare commits
3 Commits
a844024395
...
v0.7.1
Author | SHA1 | Date | |
---|---|---|---|
|
b44ed287dd | ||
|
20c469245c | ||
|
77cf2d794e |
@@ -31,20 +31,18 @@ help(){
|
|||||||
exec "$bees_bin" --help
|
exec "$bees_bin" --help
|
||||||
}
|
}
|
||||||
|
|
||||||
get_bees_supp_opts(){
|
for i in $("$bees_bin" --help 2>&1 | grep -E "--" | sed -e "s/^[^-]*-/-/" -e "s/,[^-]*--/ --/" -e "s/ [^-]*$//")
|
||||||
"$bees_bin" --help |& awk '/--../ { gsub( ",", "" ); print $1 " " $2}'
|
do
|
||||||
}
|
TMP_ARGS="$TMP_ARGS $i"
|
||||||
|
done
|
||||||
SUPPORTED_ARGS=(
|
IFS=" " read -r -a SUPPORTED_ARGS <<< $TMP_ARGS
|
||||||
$(get_bees_supp_opts)
|
|
||||||
)
|
|
||||||
NOT_SUPPORTED_ARGS=()
|
NOT_SUPPORTED_ARGS=()
|
||||||
ARGUMENTS=()
|
ARGUMENTS=()
|
||||||
|
|
||||||
for arg in "${@}"; do
|
for arg in "${@}"; do
|
||||||
supp=false
|
supp=false
|
||||||
for supp_arg in "${SUPPORTED_ARGS[@]}"; do
|
for supp_arg in "${SUPPORTED_ARGS[@]}"; do
|
||||||
if [ "$arg" == "$supp_arg" ]; then
|
if [[ "$arg" == ${supp_arg}* ]]; then
|
||||||
supp=true
|
supp=true
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@@ -73,7 +71,7 @@ done
|
|||||||
[ -z "$UUID" ] && help
|
[ -z "$UUID" ] && help
|
||||||
|
|
||||||
|
|
||||||
FILE_CONFIG="$(egrep -l '^[^#]*UUID\s*=\s*"?'"$UUID" "$CONFIG_DIR"/*.conf | head -1)"
|
FILE_CONFIG="$(grep -E -l '^[^#]*UUID\s*=\s*"?'"$UUID" "$CONFIG_DIR"/*.conf | head -1)"
|
||||||
[ ! -f "$FILE_CONFIG" ] && ERRO "No config for $UUID"
|
[ ! -f "$FILE_CONFIG" ] && ERRO "No config for $UUID"
|
||||||
INFO "Find $UUID in $FILE_CONFIG, use as conf"
|
INFO "Find $UUID in $FILE_CONFIG, use as conf"
|
||||||
source "$FILE_CONFIG"
|
source "$FILE_CONFIG"
|
||||||
|
Reference in New Issue
Block a user