template

a simple template tool for shell scripts
Log | Files | Refs

commit 7df7e6e7c7912a465032dbeb78243941099d258e
parent b0e09ddca612774abe589daa1e6b6bc53b11386e
Author: thing1 <thing1@seacrossedlovers.xyz>
Date:   Fri, 22 Aug 2025 22:36:08 +0100

added a man page

Diffstat:
MMakefile | 8++++++--
Atemplate.1 | 38++++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,6 +1,7 @@ CFLAGS=-ggdb SRC=template.c -DIR=/usr/local/bin +PREFIX=/usr/local/bin +MANPREFIX=/usr/local/share/man all: template @@ -11,7 +12,10 @@ clean: rm template install: template - cp template ${DIR}/ + mkdir -p ${PREFIX} + mkdir -p ${MANPREFIX}/man1 + cp template ${PREFIX}/ + cp template.1 ${MANPREFIX}/man1/ uninstall: rm ${DIR}/template diff --git a/template.1 b/template.1 @@ -0,0 +1,38 @@ +.TH TEMPLATE 1 +.SH NAME +template \- a simple templating tool +.SH SYNOPSIS +.B template +.B [ \-h ] [ \-d delim ] [ file ] +.SH DESCRIPTION +.ll 80 +Template is a simple templating tool, it allows for environment variables to +be inserted into a template file. The tool can be used to generate any number +of things, including log files, and static sites. + +A file can be given at any of the arguemnts if wanted; specifying '-' will +use stdin as the template file, giving no file will do the same. +.SH OPTIONS +.TP +.B \-h +prints out a simple help message +.TP +.B \-d delim +sets the deliminer character, the default is ':' + +.SH Example +In the template file, place the name of an environment variable inbetween the +deliminer charaters. + +<p>:DISPLAY:</p> + +$ template example.html + +<p>:0</p> + +.SH Notes +Delim can only be 1 character long, and UTF8 is not supported as a char is +used to store the value + +.SH BUGS +Hopefully none