Commit ed0caf0b authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue

[_cranspasswords] Améliorations + découpage du gros bloc central

parent 7a2b4a45
......@@ -7,12 +7,24 @@ _cranspasswords(){
cmd=$words[$END]
case $cmd in
--server)
liste_serveurs=($(cranspasswords --list-servers 2> /dev/null | tail -n +2 | awk '{print $2}' | tr '\n' ' '))
for i in $liste_serveurs; do
_wanted server expl "server names" compadd $i;
done;
_cranspasswords_servers
;;
--view | --edit)
_cranspasswords_files
;;
--roles)
_cranspasswords_roles
;;
*)
_cranspasswords_args
;;
esac
else
_cranspasswords_files
fi
}
_cranspasswords_files(){
pos=$words[(i)--server]
posa=$(( pos + 1))
......@@ -37,8 +49,9 @@ _cranspasswords(){
_wanted files expl "file names" compadd $i;
done;
fi;
;;
--roles)
}
_cranspasswords_roles(){
pos=$words[(i)--server]
posa=$(( pos + 1))
......@@ -63,14 +76,13 @@ _cranspasswords(){
_wanted roles expl "role names" compadd $i;
done;
fi;
;;
*)
_cranspasswords_args $@
;;
esac
else
_cranspasswords_args $@
fi
}
_cranspasswords_servers(){
liste_serveurs=($(cranspasswords --list-servers 2> /dev/null | tail -n +2 | awk '{print $2}' | tr '\n' ' '))
for i in $liste_serveurs; do
_wanted server expl "server names" compadd $i;
done;
}
_cranspasswords_args(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment