mvdan / sh

A shell parser, formatter, and interpreter with bash support; includes shfmt
https://pkg.go.dev/mvdan.cc/sh/v3
BSD 3-Clause "New" or "Revised" License
6.97k stars 332 forks source link

man page: incorrect statement regarding use of `-` (read from stdin) and `--filename` flag #1079

Open ktetzlaff opened 1 month ago

ktetzlaff commented 1 month ago

A little nitpick ...

The shfmt man page states

If any EditorConfig files are found, they will be used to apply formatting options. If any parser or printer flags are given to the tool, no EditorConfig formatting options will be used. A default like -i=0 can be used for this purpose.

Here's the problem: The --filename flag, which is intended to help with finding EditorConfig files when reading from stdin is listed under Parser flags and thus (according to the statement above) should stop EditorConfig formatting options from being used.

Possible solutions:

  1. Move the --filename flag to either the Generic or Utility flags section, or
  2. add an explicit exception for the --filename flag to the statement quoted above.