-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgen.1
90 lines (89 loc) · 2.58 KB
/
gen.1
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
82
83
84
85
86
87
88
89
90
.TH GENERATE "1" "March 2024" "gen version: 2.1.0" "User Commands"
.SH NAME
Generate \- create script using templates.
.SH SYNOPSIS
.B gen
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]...
.SH DESCRIPTION
Create FILE, modify permissions, redirect script template to FILE, and launch default editor.
.BR
.TP
A FILE argument that exists will not be overwritten/modified, unless \fB\-f\fR is supplied.
.SH OPTIONS
.TP
\fB\-c\fR,
change FILE permissions with octal or symbolic mode bits (\fB\ gen -c\fR 754 example.sh,\fB\ gen -c\fR u+x example.sh )
.BR
.TP
\fB\-d\fR,
use default template despite available custom template
.BR
.TP
\fB\-e\fR,
manually select editor (\fB\ gen -e nano\fR example.py )
.BR
.TP
\fB\-f\fR,
overwrite existing FILE contents, never prompt
.BR
.TP
\fB\-h\fR,
display help and exit
.BR
.TP
\fB\-q\fR,
quiet automatic input of script template
.BR
.TP
\fB\-s\fR,
suppress editor launch
.BR
.TP
\fB\-v\fR,
display version number and exit
.SH "EDITORS"
.B gen
checks the variables VISUAL & EDITOR (in order), if non-empty and found in PATH
.B gen
will use the value of these variables.
.BR
.TP
Otherwise, PATH will be checked for\fB\ nano, vi, emacs, ed\fR (in order). The first command in PATH will be used. If no command is found,\fB\ gen\fR\ with exit with exit status 127 (see also\fB\ EXIT STATUS\fR\ below).
.BR
.TP
If argument \fB\-e\fR is given,\fB\ gen\fR will search PATH for OPTARG.
.SH "FILE PERMISSIONS"
When applicable,\fB\ gen\fR uses\fB chmod\fR\ to give execute permissions to the user; if errors occur, an error message from\fB\ chmod\fR will be displayed.
.BR
.TP
Otherwise, read & write permissions are set for the user to ensure minimum functionality. In either case, symbolic modes are used to promote least privilege ( u+rw ).
.BR
.SH "EXIT STATUS"
If there were no problems during execution,\fB\ gen\fR exits with the value\fB\ 0\fR.
.BR
.TP
If an error occurs,\fB\ gen\fR exits with a non-zero value that may provide some context as below:
.BR
.TP
\fB2\fR,
General error, typically mistyped or incorrect argument.
.BR
.TP
\fB126\fR,
This is a permission error, or command found that is not executable.
.BR
.TP
\fB127\fR,
Command does not exist or command not found in PATH.
.SH AUTHOR
Written by Zac Piatt.
.SH "REPORTING BUGS"
Report any bugs to <[email protected]>
.SH COPYRIGHT
Copyright \(co 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
Full documentation <https://github.com/zpiatt/gen>