|
|
33b7a40 |
.TH JSONNNET "1" "June 2021" "" "User Commands"
|
|
|
33b7a40 |
.SH NAME
|
|
|
33b7a40 |
jsonnetfmt \- jsonnet reformatter
|
|
|
33b7a40 |
.SH SYNOPSIS
|
|
|
33b7a40 |
.B jsonnetfmt
|
|
|
33b7a40 |
.RI [ option \ ...]
|
|
|
33b7a40 |
.RI [ filename ]
|
|
|
33b7a40 |
.SH OPTIONS
|
|
|
33b7a40 |
In all cases:
|
|
|
33b7a40 |
.RS +3n
|
|
|
33b7a40 |
.IP \(bu 2
|
|
|
33b7a40 |
.I filename
|
|
|
33b7a40 |
can be
|
|
|
33b7a40 |
.B \-
|
|
|
33b7a40 |
(stdin)
|
|
|
33b7a40 |
.IP \(bu 2
|
|
|
33b7a40 |
Multichar options are expanded e.g. \fB\-abc\fR becomes
|
|
|
33b7a40 |
.BR \-a\ \-b\ \-c .
|
|
|
33b7a40 |
.IP \(bu 2
|
|
|
33b7a40 |
The
|
|
|
33b7a40 |
.B \--
|
|
|
33b7a40 |
option suppresses option processing for subsequent arguments.
|
|
|
33b7a40 |
.IP \(bu 2
|
|
|
33b7a40 |
Note that since filenames and jsonnet programs can begin with
|
|
|
33b7a40 |
.BR - ,
|
|
|
33b7a40 |
it is advised to use
|
|
|
33b7a40 |
.B \-\-
|
|
|
33b7a40 |
if the argument is unknown, e.g. \fBjsonnet\ \-\-\ "$\fIFILENAME\fB"\fR.
|
|
|
33b7a40 |
.RE
|
|
|
33b7a40 |
.SS "AVAILABLE OPTIONS"
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-h\fR,\ \fB\-\-help
|
|
|
33b7a40 |
Print a usage message
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-e\fR,\ \fB\-\-exec
|
|
|
33b7a40 |
Treat
|
|
|
33b7a40 |
.I filename
|
|
|
33b7a40 |
as code
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-o\fR,\ \fB\-\-output\-file \fIfile
|
|
|
33b7a40 |
Write to the output file rather than stdout
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-i\fR,\ \fB\-\-in\-place
|
|
|
33b7a40 |
Update the Jsonnet file(s) in place
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-\-test
|
|
|
33b7a40 |
Exit with failure if reformatting changed the file(s)
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-n\fR,\ \-\-indent\ \fIn
|
|
|
33b7a40 |
Number of spaces to indent by (default
|
|
|
33b7a40 |
.BR 2 ,
|
|
|
33b7a40 |
.B 0
|
|
|
33b7a40 |
means no change)
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-\-string\-style\ \fR[\fBd\fR|\fBs\fR|\fBl\fR]
|
|
|
33b7a40 |
Enforce
|
|
|
33b7a40 |
.IR d ouble,
|
|
|
33b7a40 |
.IR s ingle
|
|
|
33b7a40 |
(default) quotes or
|
|
|
33b7a40 |
.RI \(oq l eave\(cq
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-\-comment\-style\ \fR[\fBh\fR|\fBs\fR|\fBl\fR]
|
|
|
33b7a40 |
.BI #\ ( h )\fR,
|
|
|
33b7a40 |
.BI //\ ( s )
|
|
|
33b7a40 |
(default), or \(oq\fIl\fReave\(cq
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.BR \-\- [ no\- ] pretty\-field\-names
|
|
|
33b7a40 |
Use syntax sugar for fields and indexing (on by default)
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.BR \-\- [ no\- ] pad\-arrays
|
|
|
33b7a40 |
.B [\ 1,\ 2,\ 3\ ]
|
|
|
33b7a40 |
instead of
|
|
|
33b7a40 |
.B [1,\ 2,\ 3]
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.BR \-\- [ no\- ] pad\-objects
|
|
|
33b7a40 |
.B {\ x:\ 1,\ y:\ 2\ }
|
|
|
33b7a40 |
instead of
|
|
|
33b7a40 |
.B {x:\ 1,\ y:\ 2}
|
|
|
33b7a40 |
(on by default)
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.BR \-\- [ no\- ] sort\-imports
|
|
|
33b7a40 |
Sorting of imports (on by default)
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-\-debug\-desugaring
|
|
|
33b7a40 |
Unparse the desugared AST without executing it
|
|
|
33b7a40 |
.TP
|
|
|
33b7a40 |
.B \-\-version
|
|
|
33b7a40 |
Print version
|
|
|
33b7a40 |
.SH "SEE\ ALSO"
|
|
|
33b7a40 |
.BR jsonnet (1)
|