-
Notifications
You must be signed in to change notification settings - Fork 1
/
shsub.1.tpl
64 lines (43 loc) · 1.58 KB
/
shsub.1.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.TH <%="$name"%> 1
.SH NAME
<%="$name"%> - compile the template to a shell script and execute it
.SH SYNOPSIS
\fB<%="$name"%>\fR [\fIoptions\fR] [\fIfile\fR\] [\fIarguments\fR]
\fB<%="$name"%>\fR \fB--help\fR
\fB<%="$name"%>\fR \fB--version\fR
.SH DESCRIPTION
\fB<%="$name"%>\fR reads the template from \fIfile\fR,
or, by default, the standard input.
A template is text
with embedded shell commands and expressions.
Shell commands are surrounded by \fB<%%\fR and \fB%%>\fR.
Shell expressions are surrounded by \fB<%%=\fR and \fB%%>\fR.
Shell commands are compiled to the commands themselves.
Each \fB<%%=\fIexpr\fB%%>\fR is compiled to \fBprintf %s \fIexpr\fR.
Ordinary text is compiled to the command printing that text.
Contents within \fB<%%!\fR and \fB%%>\fR are regarded as comments
and are ignored.
A template can include other templates by \fB<%%+\fIfilename\fB%%>\fR.
If \fB-%%>\fR is used instead of \fB%%>\fR
to end a command, expression, including, or comment,
the following newline character will be ignored.
\fB<%%%\fR and \fB%%%>\fR are compiled to literal \fB<%%\fR and \fB%%>\fR.
\fIArguments\fR are passed to the compiled script while execution.
.SH OPTIONS
.TP
\fB\-s\fR \fIpath\fR
Set which shell is used to execute the script
(default: \fB/bin/sh\fR)
.TP
.B \-c
Compile the template without execution
.TP
\fB\-o\fR \fIpath\fR
Set the path of the output script if \fB-c\fR is enabled
.SH AUTHORS
Shsub was created by
DONG Yuxuan <https://www.dyx.name> in 2022.
.SH VERSION
This man page is for Shsub <%="$version"%>.
.SH FURTHER DOCUMENTATION
See <https://github.com/dongyx/shsub>.