Skip to content

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

Closed

Description

@ktetzlaff

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.

Activity

  1. mvdan commented on Oct 19, 2024

    @mvdan
    Owner

    Good point, and thank you for bringing it up. I agree with your first suggestion; even though the filename affects the parser, it also affects other parts of the tool such as the EditorConfig logic, so it can go under generic flags.

  2. added a commit that references this issue on Oct 19, 2024
    9482bff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址