ajout de sieve
This commit is contained in:
parent
272c504d37
commit
0e7c9623c5
|
@ -10,6 +10,7 @@ EXTS=(
|
||||||
txt:text
|
txt:text
|
||||||
conf:conf
|
conf:conf
|
||||||
sql:sql
|
sql:sql
|
||||||
|
sieve:sieve
|
||||||
mdt:markdown mdwn:markdown md:markdown text:markdown
|
mdt:markdown mdwn:markdown md:markdown text:markdown
|
||||||
twp:twpage
|
twp:twpage
|
||||||
puml:puml
|
puml:puml
|
||||||
|
@ -43,7 +44,7 @@ TEMPLATES=(
|
||||||
|
|
||||||
# Scripts à utiliser pour générer les templates
|
# Scripts à utiliser pour générer les templates
|
||||||
TEMPLS=(
|
TEMPLS=(
|
||||||
text:text conf:text sql:text
|
text:text conf:text sql:text sieve:text
|
||||||
markdown:wiki twpage:wiki
|
markdown:wiki twpage:wiki
|
||||||
puml:plantuml iuml:plantuml
|
puml:plantuml iuml:plantuml
|
||||||
shell:shell
|
shell:shell
|
||||||
|
|
|
@ -23,9 +23,9 @@ OPTIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
NAME=text
|
NAME=text
|
||||||
TEMPLATES=(text conf sql)
|
TEMPLATES=(text conf sql sieve)
|
||||||
NAMES=()
|
NAMES=()
|
||||||
EXTS=(txt conf sql)
|
EXTS=(txt conf sql sieve)
|
||||||
|
|
||||||
if [ $# -eq 2 ]; then
|
if [ $# -eq 2 ]; then
|
||||||
if [ "$1" == "--matches-template" ]; then
|
if [ "$1" == "--matches-template" ]; then
|
||||||
|
@ -92,6 +92,17 @@ function generate_sql() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generate_sieve() {
|
||||||
|
local file="$1"
|
||||||
|
local mode=sieve
|
||||||
|
|
||||||
|
check_overwrite "$1" || return
|
||||||
|
estep "$(ppath "$file")"
|
||||||
|
echo >"$file" "-- -*- coding: $encoding ${mode:+mode: $mode }-*- vim:sw=4:sts=4:et:ai:si:sta:fenc=$encoding"
|
||||||
|
[ -n "$2" ] && array_add "$2" "$file"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
template=
|
template=
|
||||||
edit=1
|
edit=1
|
||||||
overwrite=
|
overwrite=
|
||||||
|
@ -126,6 +137,7 @@ for file in "$@"; do
|
||||||
text|txt|t) generate_text "$file" files2edit || r=$?;;
|
text|txt|t) generate_text "$file" files2edit || r=$?;;
|
||||||
conf|c) generate_conf "$file" files2edit || r=$?;;
|
conf|c) generate_conf "$file" files2edit || r=$?;;
|
||||||
sql) generate_sql "$file" files2edit || r=$?;;
|
sql) generate_sql "$file" files2edit || r=$?;;
|
||||||
|
sieve) generate_sieve "$file" files2edit || r=$?;;
|
||||||
*) die "$NAME: template invalide: $t";;
|
*) die "$NAME: template invalide: $t";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue