From 9e8b262d6c5d23e2133ed101319f2d9da92571b1 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Tue, 25 Feb 2014 05:25:52 +0400 Subject: [PATCH] =?UTF-8?q?possibilit=C3=A9=20de=20sp=C3=A9cifier=20le=20t?= =?UTF-8?q?ype=20par=20d=C3=A9faut=20de=20script=20shell=20=C3=A0=20g?= =?UTF-8?q?=C3=A9n=C3=A9rer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/default/utempl | 6 ++++++ lib/templates/shell | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 lib/default/utempl diff --git a/lib/default/utempl b/lib/default/utempl new file mode 100644 index 0000000..d600830 --- /dev/null +++ b/lib/default/utempl @@ -0,0 +1,6 @@ +# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 +# Paramètres par défaut pour utempl + +# Type de script shell à générer par défaut: system-or-local, default, manual, +# vanilla. Utiliser auto pour l'autodétection. +#SHELL_TYPE=auto \ No newline at end of file diff --git a/lib/templates/shell b/lib/templates/shell index 4227bd9..46fc97b 100755 --- a/lib/templates/shell +++ b/lib/templates/shell @@ -57,6 +57,8 @@ source "$(dirname "$0")/../../ulib/ulib" && urequire DEFAULTS || exit 1 +set_defaults utempl + function check_overwrite() { if [ -e "$1" -a -z "$overwrite" ]; then eerror "$1: refus d'écraser un fichier déjà existant (utiliser -f)" @@ -77,6 +79,7 @@ function generate_shell() { default|def|d) type=default;; manual|man|m) type=manual;; vanilla|van|v) type=vanilla;; + auto|a) type=;; esac local modeline="# -*- coding: $encoding ${mode:+mode: $mode }-*- vim:sw=4:sts=4:et:ai:si:sta:fenc=$encoding" @@ -191,7 +194,7 @@ $modeline" } template= -type= +type="$SHELL_TYPE" edit=1 overwrite= encoding=