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

[_cranspasswords] Last feature

parent ed0caf0b
......@@ -20,7 +20,11 @@ _cranspasswords(){
;;
esac
else
_cranspasswords_files
if [[ $words[2] == '-' ]]; then
_cranspasswords_args
else
_cranspasswords_files
fi;
fi
}
......@@ -41,12 +45,12 @@ _cranspasswords_files(){
liste_fichiers=($(cranspasswords --server $server --list 2>/dev/null | tail -n +2 | head -n -1 | awk '{print $2}' | tr '\n' ' '))
echo $liste_fichiers > /tmp/$fname
for i in $liste_fichiers; do
_wanted files expl "file names" compadd $i;
_wanted files expl "file names on ${server}" compadd $i;
done;
else
liste_fichiers=($(cat /tmp/$fname))
for i in $liste_fichiers; do
_wanted files expl "file names" compadd $i;
_wanted files expl "file names on ${server}" compadd $i;
done;
fi;
}
......@@ -68,12 +72,12 @@ _cranspasswords_roles(){
liste_fichiers=($(cranspasswords --server $server --list-roles 2>/dev/null | tail -n +2 | awk '{print $2}' | tr '\n' ' '))
echo $liste_fichiers > /tmp/$fname
for i in $liste_fichiers; do
_wanted roles expl "role names" compadd $i;
_wanted roles expl "role names on ${server}" compadd $i;
done;
else
liste_fichiers=($(cat /tmp/$fname))
for i in $liste_fichiers; do
_wanted roles expl "role names" compadd $i;
_wanted roles expl "role names on ${server}" compadd $i;
done;
fi;
}
......
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