[enh] There should be a command plugin

This commit is contained in:
alban 2020-06-03 21:51:15 +02:00
parent a5cf3456c6
commit 68bd4f90d3
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
#!/bin/bash
# Add a content line by decorating the input with triple backticks ```
PLUGIN_CONTENT+=( hookContentCmd )
hookContentCmd(){
[[ -z "$1" ]] && echo "Add a shell command line" && return
TMP="$1"
read -e -p "Command line? " CMD
[[ -z "$CMD" ]] && panic "Not a valid content" && return
echo "\`\`\`$CMD\`\`\`" >> $TMP
}