bake/bake.1

65 lines
1.6 KiB
Groff

.TH BAKE "1" "August 2024" "bake 20240804" "User Commands"
.SH NAME
.B bake
\- file embeddable scripts
.SH SYNOPSIS
.B bake
[\-chln] [\-s <n>] <FILENAME> [ARGS...]
.SH DESCRIPTION
bake is a simple tool meant to execute embedded shell commands within
any file. It executes with /bin/sh the command after a "\fB@BAKE\fP " to
the end of the line (a UNIX newline: '\fB\\n\fP').
This format may be embedded within \fBbinary files\fP, or any file where no unwanted preceding
instance of \fB@BAKE\fP appears.
It roots the shell execution in the directory of the given file.
Options must always be put first, and short options may be merged together.
.HP
\fB\-c \-\-color\fP, \-h \-\-help, \fB\-n \-\-dry\-run\fP, \fB\-l \-\-list\fP, \fB\-s \-\-select\fP <\fBn\fP>
.PP
Macros
All macros can be exempted by prefixing them with a backslash,
which'll be subtracted in the expansion. multi-line commands may be
done by a leading backslash, which are NOT subtracted.
These macros will expand to their counterpart before execution.
.TP
.B @FILENAME, @NAME, $@
returns target\-file (abc.x.txt)
.TP
.B @SHORT, $*
returns target\-file without suffix (abc.x.txt \-> abc.x)
.TP
.B @ARGS, $+
returns
.B arguments
.TP
.B @LINE
returns the line number
.PP
Additional Features And Notes
Shell execution may be disabled with the \fB-n\fP or \fB--dry-run\fP option.
Colors may be disabled with the \fB-c\fP or \fB--color\fP option.
.SH EXAMPLE
.\" SRC BEGIN (example.c)
.EX
// example.c @BAKE cc -o @SHORT @NAME @ARGS
#include <stdio.h>
int main (void) {
puts("Hello.");
return 0;
}
.EE
.SH COPYRIGHT
.PP
Licensed under the public domain.