Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc/man: Add man pages jsonnet.1 and jsonnetfmt.1 #1206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ endif()
set(CMAKE_CXX_STANDARD 17)


# Manuals
add_subdirectory(doc/man)
install(FILES doc/man/jsonnet.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
install(FILES doc/man/jsonnetfmt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)

# Include external googletest project. This runs a CMake sub-script
# (CMakeLists.txt.in) that downloads googletest source. It's then built as part
# of the jsonnet project. The conventional way of handling CMake dependencies is
Expand Down
2 changes: 2 additions & 0 deletions doc/man/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install(DIRECTORY man1/ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
FILES_MATCHING PATTERN "*.1")
97 changes: 97 additions & 0 deletions doc/man/jsonnet.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH JSONNET "1" "January 2025" "Jsonnet commandline interpreter v0.20.0" "User Commands"
.SH NAME
Jsonnet \- Jsonnet data templating language interpreter
.SH DESCRIPTION
Jsonnet commandline interpreter v0.20.0
.PP
jsonnet {<option>} <filename>
.SS "Available options:"
.TP
\fB\-h\fR / \fB\-\-help\fR
This message
.TP
\fB\-e\fR / \fB\-\-exec\fR
Treat filename as code
.TP
\fB\-J\fR / \fB\-\-jpath\fR <dir>
Specify an additional library search dir (right\-most wins)
.HP
\fB\-o\fR / \fB\-\-output\-file\fR <file> Write to the output file rather than stdout
.TP
\fB\-m\fR / \fB\-\-multi\fR <dir>
Write multiple files to the directory, list files on stdout
.TP
\fB\-y\fR / \fB\-\-yaml\-stream\fR
Write output as a YAML stream of JSON documents
.TP
\fB\-S\fR / \fB\-\-string\fR
Expect a string, manifest as plain text
.TP
\fB\-s\fR / \fB\-\-max\-stack\fR <n>
Number of allowed stack frames
.TP
\fB\-t\fR / \fB\-\-max\-trace\fR <n>
Max length of stack trace before cropping
.TP
\fB\-\-gc\-min\-objects\fR <n>
Do not run garbage collector until this many
.HP
\fB\-\-gc\-growth\-trigger\fR <n> Run garbage collector after this amount of object growth
.TP
\fB\-\-version\fR
Print version
.PP
Available options for specifying values of 'external' variables:
Provide the value as a string:
.TP
\fB\-V\fR / \fB\-\-ext\-str\fR <var>[=<val>]
If <val> is omitted, get from environment var <var>
.HP
\fB\-\-ext\-str\-file\fR <var>=<file> Read the string from the file
.SS "Provide a value as Jsonnet code:"
.TP
\fB\-\-ext\-code\fR <var>[=<code>]
If <code> is omitted, get from environment var <var>
.HP
\fB\-\-ext\-code\-file\fR <var>=<file> Read the code from the file
.PP
Available options for specifying values of 'top\-level arguments':
Provide the value as a string:
.TP
\fB\-A\fR / \fB\-\-tla\-str\fR <var>[=<val>]
If <val> is omitted, get from environment var <var>
.HP
\fB\-\-tla\-str\-file\fR <var>=<file> Read the string from the file
.SS "Provide a value as Jsonnet code:"
.TP
\fB\-\-tla\-code\fR <var>[=<code>]
If <code> is omitted, get from environment var <var>
.HP
\fB\-\-tla\-code\-file\fR <var>=<file> Read the code from the file
.PP
Environment variables:
JSONNET_PATH is a colon (semicolon on Windows) separated list of directories added
in reverse order before the paths specified by \fB\-\-jpath\fR (i.e. left\-most wins)
E.g. JSONNET_PATH=a:b jsonnet \fB\-J\fR c \fB\-J\fR d is equivalent to:
JSONNET_PATH=d:c:a:b jsonnet
jsonnet \fB\-J\fR b \fB\-J\fR a \fB\-J\fR c \fB\-J\fR d
.PP
In all cases:
<filename> can be \- (stdin)
Multichar options are expanded e.g. \fB\-abc\fR becomes \fB\-a\fR \fB\-b\fR \fB\-c\fR.
The \fB\-\-\fR option suppresses option processing for subsequent arguments.
Note that since filenames and jsonnet programs can begin with \-, it is advised to
use \fB\-\-\fR if the argument is unknown, e.g. jsonnet \fB\-\-\fR "$FILENAME".
.SH "SEE ALSO"
The full documentation for
.B Jsonnet
is maintained as a Texinfo manual. If the
.B info
and
.B Jsonnet
programs are properly installed at your site, the command
.IP
.B info Jsonnet
.PP
should give you access to the complete manual.
70 changes: 70 additions & 0 deletions doc/man/jsonnetfmt.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH JSONNET "1" "January 2025" "Jsonnet reformatter v0.20.0" "User Commands"
.SH NAME
Jsonnet \- Jsonnet data templating language reformatter
.SH DESCRIPTION
Jsonnet reformatter v0.20.0
.PP
jsonnetfmt {<option>} { <filename> }
.SS "Available options:"
.TP
\fB\-h\fR / \fB\-\-help\fR
This message
.TP
\fB\-e\fR / \fB\-\-exec\fR
Treat filename as code
.HP
\fB\-o\fR / \fB\-\-output\-file\fR <file> Write to the output file rather than stdout
.TP
\fB\-i\fR / \fB\-\-in\-place\fR
Update the Jsonnet file(s) in place.
.TP
\fB\-\-test\fR
Exit with failure if reformatting changed the file(s).
.TP
\fB\-n\fR / \fB\-\-indent\fR <n>
Number of spaces to indent by (default 2, 0 means no change)
.TP
\fB\-\-max\-blank\-lines\fR <n>
Max vertical spacing, 0 means no change (default 2)
.TP
\fB\-\-string\-style\fR <d|s|l>
Enforce double, single (default) quotes or 'leave'
.HP
\fB\-\-comment\-style\fR <h|s|l> # (h), // (s)(default), or 'leave'; never changes she\-bang
.HP
\fB\-\-[no\-]pretty\-field\-names\fR Use syntax sugar for fields and indexing (on by default)
.TP
\fB\-\-[no\-]pad\-arrays\fR
[ 1, 2, 3 ] instead of [1, 2, 3]
.TP
\fB\-\-[no\-]pad\-objects\fR
{ x: 1, y: 2 } instead of {x: 1, y: 2} (on by default)
.TP
\fB\-\-[no\-]sort\-imports\fR
Sorting of imports (on by default)
.TP
\fB\-\-debug\-desugaring\fR
Unparse the desugared AST without executing it
.TP
\fB\-\-version\fR
Print version
.PP
In all cases:
<filename> can be \- (stdin)
Multichar options are expanded e.g. \fB\-abc\fR becomes \fB\-a\fR \fB\-b\fR \fB\-c\fR.
The \fB\-\-\fR option suppresses option processing for subsequent arguments.
Note that since filenames and jsonnet programs can begin with \-, it is advised to
use \fB\-\-\fR if the argument is unknown, e.g. jsonnet \fB\-\-\fR "$FILENAME".
.SH "SEE ALSO"
The full documentation for
.B Jsonnet
is maintained as a Texinfo manual. If the
.B info
and
.B Jsonnet
programs are properly installed at your site, the command
.IP
.B info Jsonnet
.PP
should give you access to the complete manual.