From 6a3492105a008a898d4a5af0e90ff0ef6383bfdd Mon Sep 17 00:00:00 2001 From: _N3m0 Date: Tue, 7 Mar 2023 09:08:44 +0100 Subject: [PATCH] ajout cs -log + ajout param au completion de cs --- completion | 6 ++++++ cs | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/completion b/completion index e107bd9..4cacae9 100644 --- a/completion +++ b/completion @@ -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 diff --git a/cs b/cs index f646b9e..2072416 100755 --- a/cs +++ b/cs @@ -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 : ouvre le cheat-sheet ou le crée s'il n'exite pas" @@ -30,6 +34,7 @@ if [[ $1 = "-h" ]]; then echo "cs -ln : 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