1JSONNNET(1) User Commands JSONNNET(1)
2
3
4
6 jsonnetfmt - jsonnet reformatter
7
9 jsonnetfmt [option ...] [filename]
10
12 In all cases:
13
14 • filename can be - (stdin)
15
16 • Multichar options are expanded e.g. -abc becomes -a -b -c.
17
18 • The -- option suppresses option processing for subsequent argu‐
19 ments.
20
21 • Note that since filenames and jsonnet programs can begin with -,
22 it is advised to use -- if the argument is unknown, e.g. json‐
23 net -- "$FILENAME".
24
25 AVAILABLE OPTIONS
26 -h, --help
27 Print a usage message
28
29 -e, --exec
30 Treat filename as code
31
32 -o, --output-file file
33 Write to the output file rather than stdout
34
35 -i, --in-place
36 Update the Jsonnet file(s) in place
37
38 --test Exit with failure if reformatting changed the file(s)
39
40 -n, --indent n
41 Number of spaces to indent by (default 2, 0 means no change)
42
43 --string-style [d|s|l]
44 Enforce double, single (default) quotes or ‘leave’
45
46 --comment-style [h|s|l]
47 # (h), // (s) (default), or ‘leave’
48
49 --[no-]pretty-field-names
50 Use syntax sugar for fields and indexing (on by default)
51
52 --[no-]pad-arrays
53 [ 1, 2, 3 ] instead of [1, 2, 3]
54
55 --[no-]pad-objects
56 { x: 1, y: 2 } instead of {x: 1, y: 2} (on by default)
57
58 --[no-]sort-imports
59 Sorting of imports (on by default)
60
61 --debug-desugaring
62 Unparse the desugared AST without executing it
63
64 --version
65 Print version
66
68 jsonnet(1)
69
70
71
72 June 2021 JSONNNET(1)