Skip to content

Commit c20046e

Browse files
committed
doc/man: Add man pages jsonnet.1 and jsonnetfmt.1
This commit adds man pages for the jsonnet and jsonnetfmt commands. The Debian Lintian quality checker warns that each binary should have a manual page, but hopefully this idea would also apply to non-Debian users. These man pages are created using the help2man command, so the contents are substantially the same as the output of the help option. Signed-off-by: Fukui Daichi <[email protected]>
1 parent 5a4e8e3 commit c20046e

File tree

4 files changed

+174
-0
lines changed

4 files changed

+174
-0
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ endif()
4646
set(CMAKE_CXX_STANDARD 17)
4747

4848

49+
# Manuals
50+
add_subdirectory(doc/man)
51+
install(FILES doc/man/jsonnet.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
52+
install(FILES doc/man/jsonnetfmt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
53+
4954
# Include external googletest project. This runs a CMake sub-script
5055
# (CMakeLists.txt.in) that downloads googletest source. It's then built as part
5156
# of the jsonnet project. The conventional way of handling CMake dependencies is

doc/man/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
install(DIRECTORY man1/ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
2+
FILES_MATCHING PATTERN "*.1")

doc/man/jsonnet.1

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2+
.TH JSONNET "1" "January 2025" "Jsonnet commandline interpreter v0.20.0" "User Commands"
3+
.SH NAME
4+
Jsonnet \- Jsonnet data templating language interpreter
5+
.SH DESCRIPTION
6+
Jsonnet commandline interpreter v0.20.0
7+
.PP
8+
jsonnet {<option>} <filename>
9+
.SS "Available options:"
10+
.TP
11+
\fB\-h\fR / \fB\-\-help\fR
12+
This message
13+
.TP
14+
\fB\-e\fR / \fB\-\-exec\fR
15+
Treat filename as code
16+
.TP
17+
\fB\-J\fR / \fB\-\-jpath\fR <dir>
18+
Specify an additional library search dir (right\-most wins)
19+
.HP
20+
\fB\-o\fR / \fB\-\-output\-file\fR <file> Write to the output file rather than stdout
21+
.TP
22+
\fB\-m\fR / \fB\-\-multi\fR <dir>
23+
Write multiple files to the directory, list files on stdout
24+
.TP
25+
\fB\-y\fR / \fB\-\-yaml\-stream\fR
26+
Write output as a YAML stream of JSON documents
27+
.TP
28+
\fB\-S\fR / \fB\-\-string\fR
29+
Expect a string, manifest as plain text
30+
.TP
31+
\fB\-s\fR / \fB\-\-max\-stack\fR <n>
32+
Number of allowed stack frames
33+
.TP
34+
\fB\-t\fR / \fB\-\-max\-trace\fR <n>
35+
Max length of stack trace before cropping
36+
.TP
37+
\fB\-\-gc\-min\-objects\fR <n>
38+
Do not run garbage collector until this many
39+
.HP
40+
\fB\-\-gc\-growth\-trigger\fR <n> Run garbage collector after this amount of object growth
41+
.TP
42+
\fB\-\-version\fR
43+
Print version
44+
.PP
45+
Available options for specifying values of 'external' variables:
46+
Provide the value as a string:
47+
.TP
48+
\fB\-V\fR / \fB\-\-ext\-str\fR <var>[=<val>]
49+
If <val> is omitted, get from environment var <var>
50+
.HP
51+
\fB\-\-ext\-str\-file\fR <var>=<file> Read the string from the file
52+
.SS "Provide a value as Jsonnet code:"
53+
.TP
54+
\fB\-\-ext\-code\fR <var>[=<code>]
55+
If <code> is omitted, get from environment var <var>
56+
.HP
57+
\fB\-\-ext\-code\-file\fR <var>=<file> Read the code from the file
58+
.PP
59+
Available options for specifying values of 'top\-level arguments':
60+
Provide the value as a string:
61+
.TP
62+
\fB\-A\fR / \fB\-\-tla\-str\fR <var>[=<val>]
63+
If <val> is omitted, get from environment var <var>
64+
.HP
65+
\fB\-\-tla\-str\-file\fR <var>=<file> Read the string from the file
66+
.SS "Provide a value as Jsonnet code:"
67+
.TP
68+
\fB\-\-tla\-code\fR <var>[=<code>]
69+
If <code> is omitted, get from environment var <var>
70+
.HP
71+
\fB\-\-tla\-code\-file\fR <var>=<file> Read the code from the file
72+
.PP
73+
Environment variables:
74+
JSONNET_PATH is a colon (semicolon on Windows) separated list of directories added
75+
in reverse order before the paths specified by \fB\-\-jpath\fR (i.e. left\-most wins)
76+
E.g. JSONNET_PATH=a:b jsonnet \fB\-J\fR c \fB\-J\fR d is equivalent to:
77+
JSONNET_PATH=d:c:a:b jsonnet
78+
jsonnet \fB\-J\fR b \fB\-J\fR a \fB\-J\fR c \fB\-J\fR d
79+
.PP
80+
In all cases:
81+
<filename> can be \- (stdin)
82+
Multichar options are expanded e.g. \fB\-abc\fR becomes \fB\-a\fR \fB\-b\fR \fB\-c\fR.
83+
The \fB\-\-\fR option suppresses option processing for subsequent arguments.
84+
Note that since filenames and jsonnet programs can begin with \-, it is advised to
85+
use \fB\-\-\fR if the argument is unknown, e.g. jsonnet \fB\-\-\fR "$FILENAME".
86+
.SH "SEE ALSO"
87+
The full documentation for
88+
.B Jsonnet
89+
is maintained as a Texinfo manual. If the
90+
.B info
91+
and
92+
.B Jsonnet
93+
programs are properly installed at your site, the command
94+
.IP
95+
.B info Jsonnet
96+
.PP
97+
should give you access to the complete manual.

doc/man/jsonnetfmt.1

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2+
.TH JSONNET "1" "January 2025" "Jsonnet reformatter v0.20.0" "User Commands"
3+
.SH NAME
4+
Jsonnet \- Jsonnet data templating language reformatter
5+
.SH DESCRIPTION
6+
Jsonnet reformatter v0.20.0
7+
.PP
8+
jsonnetfmt {<option>} { <filename> }
9+
.SS "Available options:"
10+
.TP
11+
\fB\-h\fR / \fB\-\-help\fR
12+
This message
13+
.TP
14+
\fB\-e\fR / \fB\-\-exec\fR
15+
Treat filename as code
16+
.HP
17+
\fB\-o\fR / \fB\-\-output\-file\fR <file> Write to the output file rather than stdout
18+
.TP
19+
\fB\-i\fR / \fB\-\-in\-place\fR
20+
Update the Jsonnet file(s) in place.
21+
.TP
22+
\fB\-\-test\fR
23+
Exit with failure if reformatting changed the file(s).
24+
.TP
25+
\fB\-n\fR / \fB\-\-indent\fR <n>
26+
Number of spaces to indent by (default 2, 0 means no change)
27+
.TP
28+
\fB\-\-max\-blank\-lines\fR <n>
29+
Max vertical spacing, 0 means no change (default 2)
30+
.TP
31+
\fB\-\-string\-style\fR <d|s|l>
32+
Enforce double, single (default) quotes or 'leave'
33+
.HP
34+
\fB\-\-comment\-style\fR <h|s|l> # (h), // (s)(default), or 'leave'; never changes she\-bang
35+
.HP
36+
\fB\-\-[no\-]pretty\-field\-names\fR Use syntax sugar for fields and indexing (on by default)
37+
.TP
38+
\fB\-\-[no\-]pad\-arrays\fR
39+
[ 1, 2, 3 ] instead of [1, 2, 3]
40+
.TP
41+
\fB\-\-[no\-]pad\-objects\fR
42+
{ x: 1, y: 2 } instead of {x: 1, y: 2} (on by default)
43+
.TP
44+
\fB\-\-[no\-]sort\-imports\fR
45+
Sorting of imports (on by default)
46+
.TP
47+
\fB\-\-debug\-desugaring\fR
48+
Unparse the desugared AST without executing it
49+
.TP
50+
\fB\-\-version\fR
51+
Print version
52+
.PP
53+
In all cases:
54+
<filename> can be \- (stdin)
55+
Multichar options are expanded e.g. \fB\-abc\fR becomes \fB\-a\fR \fB\-b\fR \fB\-c\fR.
56+
The \fB\-\-\fR option suppresses option processing for subsequent arguments.
57+
Note that since filenames and jsonnet programs can begin with \-, it is advised to
58+
use \fB\-\-\fR if the argument is unknown, e.g. jsonnet \fB\-\-\fR "$FILENAME".
59+
.SH "SEE ALSO"
60+
The full documentation for
61+
.B Jsonnet
62+
is maintained as a Texinfo manual. If the
63+
.B info
64+
and
65+
.B Jsonnet
66+
programs are properly installed at your site, the command
67+
.IP
68+
.B info Jsonnet
69+
.PP
70+
should give you access to the complete manual.

0 commit comments

Comments
 (0)