Skip to content

Feature request: allow omitting --name flag when reading from std.in #1016

@craigfe

Description

@craigfe

Is your feature request related to a problem? Please describe.
Related to #1015, perhaps the {--impl,--intf,--use-file} flags should avoid the need to pass a filename when reading from standard input:

echo "let x = ()" | ocamlformat --profile=conventional --impl -

ocamlformat: Must specify name when reading from stdin

Describe the solution you'd like
Make --impl, --intf, --use-file override the need to pass a --name option. Relatedly, I think the error message when no flags are passed should suggest using one of the former rather than suggesting passing a name e.g.:

echo "let x = ()" | ocamlformat --profile=conventional -

ocamlformat: Must use one of {--impl, --intf, --use-file} to specify the file-type 
             when reading from stdin.

(as a user, I was initially confused as to why OCamlformat needed me to pass a --name in this case)

CC. @Julow

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions