deploy: support des options --of, --df, --lf
This commit is contained in:
parent
c1a536be52
commit
3bbabbf811
|
@ -30,8 +30,8 @@ function deploy_query_recursive() {
|
||||||
|
|
||||||
function deploy_query_once() {
|
function deploy_query_once() {
|
||||||
# Afficher le résultat d'une requête
|
# Afficher le résultat d'une requête
|
||||||
local alv sov slv sdv
|
local alv sov sdv slv sof sdf slf
|
||||||
eval "set -- $(getopt -ov:old -lallow-vars:,object-vars,link-vars,dest-vars -- "$@")"
|
eval "set -- $(getopt -ov:odl -lallow-vars:,object-vars,dest-vars,link-vars,of:,object-func:,df:,dest-func:,lf:,link-func: -- "$@")"
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-v|--allow-vars)
|
-v|--allow-vars)
|
||||||
|
@ -39,8 +39,11 @@ function deploy_query_once() {
|
||||||
shift; shift
|
shift; shift
|
||||||
;;
|
;;
|
||||||
-o|--object-vars) sov=1; shift;;
|
-o|--object-vars) sov=1; shift;;
|
||||||
-l|--link-vars) slv=1; shift;;
|
|
||||||
-d|--dest-vars) sdv=1; shift;;
|
-d|--dest-vars) sdv=1; shift;;
|
||||||
|
-l|--link-vars) slv=1; shift;;
|
||||||
|
--of|--object-func) sof="$2"; shift; shift;;
|
||||||
|
--df|--dest-func) sdf="$2"; shift; shift;;
|
||||||
|
--lf|--link-func) slf="$2"; shift; shift;;
|
||||||
--) shift; break;;
|
--) shift; break;;
|
||||||
*) break;;
|
*) break;;
|
||||||
esac
|
esac
|
||||||
|
@ -98,7 +101,7 @@ function deploy_query_once() {
|
||||||
if [ -n "$sov" ]; then
|
if [ -n "$sov" ]; then
|
||||||
deploy_copy_object_values vs "$object" "$type"
|
deploy_copy_object_values vs "$object" "$type"
|
||||||
deploy_show_values vs "$type" "$format" shell alv
|
deploy_show_values vs "$type" "$format" shell alv
|
||||||
deploy_show_attrs "$object" "$type" "$format" alv vars
|
deploy_show_attrs "$object" "$type" "$format" alv vars "$sof"
|
||||||
fi
|
fi
|
||||||
if [ -n "$sdv" ]; then
|
if [ -n "$sdv" ]; then
|
||||||
local -a pons pgns ons gns ans ovs os; local an av o
|
local -a pons pgns ons gns ans ovs os; local an av o
|
||||||
|
@ -107,10 +110,10 @@ function deploy_query_once() {
|
||||||
for hv in "${hvs[@]}"; do
|
for hv in "${hvs[@]}"; do
|
||||||
deploy_copy_object_values hs "$hv" host
|
deploy_copy_object_values hs "$hv" host
|
||||||
deploy_show_values hs host "$format" shell alv
|
deploy_show_values hs host "$format" shell alv
|
||||||
deploy_show_attrs "$hn" host "$format" alv vars
|
deploy_show_attrs "$hn" host "$format" alv vars "$sdf"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
deploy_show_links "$object" "$link" "$profile" "$format" "" alv vars
|
deploy_show_links "$object" "$link" "$profile" "$format" "" alv vars "$slf"
|
||||||
[ "$format" == shell ] && echo true
|
[ "$format" == shell ] && echo true
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
@ -295,6 +298,7 @@ function deploy_show_attrs() {
|
||||||
deploy_copy_attr_values vs "$an" "$o" "$t" ons
|
deploy_copy_attr_values vs "$an" "$o" "$t" ons
|
||||||
deploy_dump_values "$an" vs
|
deploy_dump_values "$an" vs
|
||||||
done
|
done
|
||||||
|
[ -n "$6" ] && echo "$6"
|
||||||
}
|
}
|
||||||
|
|
||||||
function deploy_show_links() {
|
function deploy_show_links() {
|
||||||
|
@ -329,6 +333,7 @@ function deploy_show_links() {
|
||||||
deploy_show_values avs "$an" "$f" shell alv
|
deploy_show_values avs "$an" "$f" shell alv
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
[ -n "$8" -a "$f" == shell ] && echo "$8"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue