-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.c.1
More file actions
82 lines (76 loc) · 2.33 KB
/
script.c.1
File metadata and controls
82 lines (76 loc) · 2.33 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.TH SCRIPT_C 1 "08 May 2025" "Adisteyf" "script.c documentation"
.SH NAME
\fBscript.c\fR \- script language & self\-build system
.SH SYNOPSIS
.
.IP \fBct\fR 20
\fBabbreviation:\fR \fICscripts\fR.
.br
this declares the start of scripting.
it can only be used once in the whole project.
use it only before \fBcte\fR.
.IP \fBcte\fR 20
\fBabbreviation:\fR \fICscripts end\fR.
.br
this declares the end of scripting.
it can only be used once in the whole project.
use it only after \fBct\fR.
.IP \fBctmd(char\ **\ \fIargs\fB)\fR 20
\fBabbreviation:\fR \fICscripts/command\fR.
.br
runs shell command using the related arguments.
.br
.B EXAMPLE:
.br
\fB ctmd(char *[]){\fI"echo"\fB, \fI"hello"\fB, \fI0\fB})\fR
.IP \fBecho(char\ *\ \fItext\fB)\fR 20
prints to \fBstdout\fR the text you want to see.
.br
just a macros on \fBctmd\fR that uses \fI"echo"\fR as the
\fBfirst argument\fR and pulls \fItext\fR to the
second one.
.IP \fBctfn(\fIx\fB)\fR 20
\fBabbreviation:\fR \fICscripts function\fR.
.br
declares the \fBfunction\fR. you \fImust use
\fBctfne()\fR at the end.
.IP \fBctfne(\fIx\fB)\fR 20
\fBabbreviation:\fR \fICscripts function end\fR.
.br
declares the end of \fBfunction\fR.
.IP \fBctrfn(\fIx\fB)\fR 20
\fBabbreviation:\fR \fICscripts run function\fR.
.br
runs a \fBfunction\fB you want.
.IP \fBctrs(\fIx\fB)\fR 20
\fBabbreviation:\fR \fICscripts restart\fR.
.br
just a macros on \fBctmd()\fR but after it runs
\fBexit(0)\fR.
.
.SH DESCRIPTION
.
scriptc is a minimalistic language for scripts
and also cool self\-build system for your
projects.
by default \fBSCRIPT\fR equals \fBmain.c\fR and
\fBSCR_BUILD\fR equals \fB./main\fR.
\fB cc script.c \-Dbuild \-DSCRIPT=\fI\\"scriptname.c\\"\fB \-DSCR_BUILD=\fI\\"./scriptname\\"\fB \-o \fIscriptname\fR
run this command if you starting your script
at first time. then you just need to run:
\fB ./\fIscriptname\fR
and it will \fIrebuild itself\fR. you can \fIchange
build command\fR using \fBctsbc()\fR function.
.
.SH EXAMPLES
example how you can make \fIscript\fR that rebuilds
itself:
.nf
\fBct
if (\fIargs\fB > \fI1\fB && \fI0\fB!=strcmp(\fIargv[1]\fB, \fI"\-\-ct\-no\-rebuild"\fB)) {
ctmd((char *[]){\fR"tcc"\fB, \fRSCRIPT\fB, \fR"\-o"\fB, \fRSRC_BUILD\fB, \fR"\-I."\fB, \fR"\-g"\fB, \fR0\fB})
ctrs((char *[]){\fRSCR_BUILD\fB, \fR"\-\-ct\-no\-rebuild"\fB, \fR0\fB})
}
\fR...\fB
cte\fR
.fi