diff options
| author | Philipp Schafft <lion@lion.leolix.org> | 2015-10-04 09:25:21 +0000 |
|---|---|---|
| committer | Philipp Schafft <lion@lion.leolix.org> | 2017-03-27 02:11:19 +0000 |
| commit | a7a5c051e4487a90c7407223ef27b1ef92939cc3 (patch) | |
| tree | 081e63c55353ec12bac42483d66c0f0e75a3c959 /webgen | |
| parent | 96e06d4fb8f685a8ecc5390f8eb8bc32ceab1be6 (diff) | |
added frame work for supporting preprocessors
Diffstat (limited to 'webgen')
| -rwxr-xr-x | webgen | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -42,10 +42,30 @@ TPLS=tpl/ HEADER=header END=end PAGE_SUFFIX='.html' -TEMPLATES="$1" +TEMPLATES='' DEFAULT_MENU='-menu-none' +PREPROCESSOR='none' # CODE: + +while [ ! -z "$1" ] +do + case "$1" in + '--preprocessor') + PREPROCESSOR="$2" + shift + ;; + '--'*) + echo "Error: Unknown option: $1" >&2 + exit 1 + ;; + *) + TEMPLATES="$1" + ;; + esac + shift +done + [ "$TEMPLATES" = '' ] && TEMPLATES="*" if [ "$TEMPLATES" = '+' ] @@ -65,7 +85,14 @@ cd $TPLS cat_file() { _file="$1" - cat -- "$_file" + case "$PREPROCESSOR" in + none) + cat -- "$_file" + ;; + *) + echo "Error: Unknown preprocessor: $PREPROCESSOR" >&2 + ;; + esac } gen_news() |
