3 homepage: https://github.com/mvdan/sh
5 shfmt: Format shell programs
8 To update or switch versions, run `webi shfmt@stable` or `webi shfmt@beta`, etc.
12 > shfmt is a shell parser, formatter and interpretter that supports POSIX Shell, Bash and mksh.
14 Usage: `shfmt <flags> <filepath>`
16 Note: If given path is directory, all shell scripts in the directory will be used.
21 Show version and exit.
24 List files whose formatting differs from shfmt's.
27 Write result to file instead of stdout.
30 Error with a diff when the formatting differs.
36 Minify the code to reduce its size (implies -s).
39 Language variant to parse (bash/posix/mksh/bats, default "bash").
42 Shorthand for -ln=posix.
45 Provide a name for the standard input file.
48 Indent: 0 for tabs (default), >0 for number of spaces.
51 Binary ops like && and | may start a line.
54 Switch cases will be indented.
57 Redirect operators will be followed by a space.
60 Keep column alignment paddings.
63 Function opening braces are placed on a separate line.
66 Recursively find all shell files and print the paths.
69 Print syntax tree to stdout as a typed JSON.
71 See https://github.com/mvdan/sh for more info.