Compare commits

..

3 Commits

Author SHA1 Message Date
295713440d manual page 2026-01-11 19:30:30 -05:00
29fdadafdb install templates and manual pages with Makefile 2026-01-11 19:30:22 -05:00
1be39bd69f template files 2026-01-11 19:29:59 -05:00
7 changed files with 302 additions and 0 deletions

View File

@@ -3,3 +3,12 @@ all:
install: install:
cp bin/yait /usr/local/bin cp bin/yait /usr/local/bin
mkdir -p /etc/yait
cp t/default/* /etc/yait
cp yait.1 /usr/local/share/man/man1/yait.1
chmod 644 /usr/local/share/man/man1/yait.1
uninstall:
$(RM) /usr/local/bin/yait
$(RM) -r /etc/yait
$(RM) /usr/local/share/man/man1/yait.1

78
t/default/c.stpl Normal file
View File

@@ -0,0 +1,78 @@
; C file template
;
;
; This is the default C file template for the yait project init tool. This file
; is auto-generated on install and can be modified to your hearts content. An
; original copy can be found at /etc/yait/
;
@def main
/*
* main.c
*
* {{PACKAGE}}/{{AUTHOR}} 0.0.1
*
* Copying policy
*
* {{PACKAGE}} 0.0.1 can be copied and distributed freely for any
* non-commercial purposes. {{PACKAGE}} 0.0.1 can only be incorporated
* into commercial software with the permission of the current author.
*
* This file contains the main driving routine.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "version.h"
#include "estruct.h"
void usage(int status)
{
printf("Usage: %s REQUIRED POSITIONAL ARGUMENT\n", PROGRAM_NAME);
printf(" or: %s [options]\n\n", PROGRAM_NAME);
fputs(" --help display this help and exit\n", stdout);
fputs(" --version output version information and exit\n", stdout);
exit(status);
}
int main(int argc, char **argv)
{
int carg;
if (argc == 2) {
if (strcmp(argv[1], "--help") == 0) {
usage(EXIT_FAILURE);
}
if (strcmp(argv[1], "--version") == 0) {
version();
exit(EXIT_SUCCESS);
}
}
puts(MESSAGE);
return 0;
}
@end
@def header
#ifndef {{MODULE}}_H_
#define {{MODULE}}_H_
#endif /* {{MODULE}}_H_ */
@end
@def impl
/* {{MODULE}}.c
*
* The routines in this file handle **things**
*
* written by {{AUTHOR}}
*/
#include "{{MODULE}}.h"
@end

12
t/default/ignore.stpl Normal file
View File

@@ -0,0 +1,12 @@
; Gitignore file template
;
;
; This is the default gitignore file template for the yait project init tool. This file
; is auto-generated on install and can be modified to your hearts content. An
; original copy can be found at /etc/yait/
;
; This file is only included when the C project strucutre is used.
;
{{PACKAGE}}
*.o

64
t/default/makefile.stpl Normal file
View File

@@ -0,0 +1,64 @@
; Makefile file template
;
;
; This is the default Makefile file template for the yait project init tool. This file
; is auto-generated on install and can be modified to your hearts content. An
; original copy can be found at /etc/yait/
;
@def C
# Makefile for {{PACKAGE}}
# Make the build silent by default
V =
ifeq ($(strip $(V)),)
E = @echo
Q = @
else
E = @\#
Q =
endif
export E Q
PROGRAM = {{PACKAGE}}
TARBALL = $(PROGRAM).tar
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
HDR = $(wildcard *.h)
CC = gcc
WARNINGS = -Wall -Wstrict-prototypes
CFLAGS = -O2 $(WARNINGS) -g
DEFINES =
LIBS =
LDFLAGS =
BINDIR = /usr/bin
LIBDIR = /usr/lib
$(PROGRAM): $(OBJ) $(HDR)
$(E) " LINK " $@
$(Q) $(CC) $(LDFLAGS) $(DEFINES) -o $@ $(OBJ) $(LIBS)
clean:
$(E) " CLEAN"
$(Q) rm -f $(PROGRAM) $(OBJ)
install: $(PROGRAM)
cp $(PROGRAM) ${BINDIR}
release: $(PROGRAM)
tar cvf $(TARBALL) $(SRC) $(HDR) Makefile README
.c.o:
$(E) " CC " $@
$(Q) $(CC) $(CFLAGS) $(DEFINES) -c $< -o $@
@end
@def sh
all:
@echo "nothing to do"
install:
cp bin/{{PACKAGE}} /usr/local/bin
@end

48
t/default/readme.stpl Normal file
View File

@@ -0,0 +1,48 @@
; READMILE file template
;
;
; This is the default README file template for the yait project init tool. This
; file is auto-generated on install and can be modified to your hearts content.
; An original copy can be found at /etc/yait/
;
# {{PACKAGE}}
https://example.com
Tagline about your tool
- Feature 1
- Feature 2
* sub point
## Install
#### Dependencies
@def c
- `c compiler` - C compiler
@end
@def sh
- `sh script` - A valid POSIX shell
@end
**Note**: `tool` is used as a part of the build process. It does many things
such as runs, exists, and consisting of more than -1 bytes
```bash
git clone https://example.com/git-tree
cd {{PACKAGE}}
@def c
make
@end
sudo make install
```
## Usage
This tool runs via the command `{{PACKAGE}}`.
- `{{PACKAGE}} --option1` -- Does a thing.
- `{{PACKAGE}} --option2` -- Does another thing.

49
t/default/sh.stpl Normal file
View File

@@ -0,0 +1,49 @@
; SH file template
;
;
; This is the default SH file template for the yait project init tool. This file
; is auto-generated on install and can be modified to your hearts content. An
; original copy can be found at /etc/yait/
;
#! /bin/sh
# {{DESCRIPTION}}
scriptversion="1"
#
#
# Copyright (C) {{YEAR}} {{AUTHOR}}
#
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
me=$0
version="$me v$scriptversion
Copyright (C) 2025-2026 vx-clutch.
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
usage="\
Usage: $me [OPTION]... <version> <dir>
{{DESCRIPTION}}
Options:
--help print this help and exit
--version output version information
"
while [ $# -gt 0 ]; do
case $1 in
--help) echo "$usage"; exit 0 ;;
--version) echo "$version"; exit 0 ;;
-*) echo "$me: Unknown option '$1'." >&2; exit 1 ;;
*) break ;;
esac
done

42
yait.1
View File

@@ -0,0 +1,42 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH YAIT "1" "January 2026" "yait v1" "User Commands"
.SH NAME
yait \- manual page for yait v1
.SH SYNOPSIS
.B yait
[\fI\,OPTION\/\fR]... \fI\,<version> <dir>\/\fR
.SH DESCRIPTION
Highly opinionated C and SH project generator
.SH OPTIONS
.TP
\fB\-\-help\fR
print this help and exit
.TP
\fB\-\-version\fR
output version information
.TP
\fB\-x\fR <language>
set project type
.TP
\fB\-S\fR
small project creation
.TP
\fB\-f\fR
overwrite existing files
.TP
\fB\-n\fR <name>
set project name
.TP
\fB\-a\fR <author>
set project author
.TP
\fB\-r\fR
initialize Git repository for the project
.TP
\fB\-q\fR
surpress output
.SH COPYRIGHT
Copyright \(co 2025\-2026 fSD.
.br
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.