ajout cs -log + ajout param au completion de cs

This commit is contained in:
_N3m0 2023-03-07 09:08:44 +01:00
parent 216c096c37
commit 6a3492105a
2 changed files with 12 additions and 1 deletions

View File

@ -29,5 +29,11 @@ cmpt_cs(){
for opt in `ls ~/dev/cheat-sheet`; do
COMPREPLY+=("$opt")
done
COMPREPLY+=("-h")
COMPREPLY+=("-l")
COMPREPLY+=("-ln")
COMPREPLY+=("-st")
COMPREPLY+=("-ci")
COMPREPLY+=("-log")
}
complete -F cmpt_cs cs

7
cs
View File

@ -17,12 +17,16 @@ if [[ $1 = "-st" ]]; then
exit
fi
if [[ $1 = "-ci" ]]; then
echo "commit avec -m : \"$2\""
cd ~/dev/cheat-sheet
git add .
git commit -am "$2"
exit
fi
if [[ $1 = "-log" ]]; then
cd ~/dev/cheat-sheet
git plog
exit
fi
if [[ $1 = "-h" ]]; then
echo "cs -h : affiche aide commande"
echo "cs <cheat-sheet> : ouvre le cheat-sheet ou le crée s'il n'exite pas"
@ -30,6 +34,7 @@ if [[ $1 = "-h" ]]; then
echo "cs -ln <cheat-sheet> <lien> : crée un lien symbolique du cheat-sheet nommé lien"
echo "cs -st : affiche le status git des cheat-sheet (eq: cd ~/dev/cheat-sheet && git status)"
echo "cs -ci \"message\" : commit les cheat-sheet (eq: cd ~/dev/cheat-sheet && git add . && git commit -am \"message\")"
echo "cs -log : affiche les log des commit git (eq: git plog)"
exit
fi