forked from ocaml-ppx/ocamlformat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanpage_ocamlformat_rpc.mld
82 lines (60 loc) · 3.11 KB
/
manpage_ocamlformat_rpc.mld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{0 Manpage: ocamlformat-rpc}
{v
NAME
ocamlformat-rpc - RPC mode for OCamlFormat, a tool to format OCaml
code.
SYNOPSIS
ocamlformat-rpc [OPTION]…
DESCRIPTION
ocamlformat-rpc listens to RPC requests, provided on the standard
input, and prints the response on the standard output.
COMMANDS
Before the client and the server agree on a common version to use the
following commands are available: Halt to close the connection to the
RPC; Version v to ask the server to use version v. If the server
agrees upon the version he will send the reply Version v and the
protocol version is set to v, to use another version later the client
has to close the connexion and start a new one. If the server cannot
use version v he might propose another version w by sending the reply
Version w that the client can accept by sending the same request for
version w, or propose another version. If the server cannot propose
another version it will close the connection. Unknown commands are
ignored.
Once the client and the server agree on a common version, the requests
you can send may differ from one version to another.
All versions support the following commands:
- Halt to end the communication with the RPC server. The caller must
close the input and output channels.
Some RPC versions offer specific commands, that are detailed below.
Specific commands supported on version v1 are:
- Config CSEXP: submits a list of (key, value) pairs (as a canonical
s-expression) to update OCamlFormat's configuration (please refer to
ocamlformat --help to know more about the available options). The
accepted configuration is sent as a reply of the same form. The
configuration can be reset to its default value by sending the pair
("profile", "default").
- Format CSEXP: submits a canonical s-expression CSEXP to be formatted
by OCamlFormat, the formatted output is sent as a reply of the same
form Format CSEXP
Specific commands supported on version v2 are:
- Format CSEXP: submits a list as canonical s-expression CSEXP, where
the first element of the list is a string to be formatted by
OCamlFormat. The other arguments are (key, value) pairs, where key can
be either "Path" and/or "Config". They modify the server's
configuration temporarily, for the current request. The formatted
output is sent as a reply of the same form.
Unknown commands are ignored.
COMMON OPTIONS
--help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto,
pager, groff or plain. With auto, the format is pager or plain
whenever the TERM env var is dumb or undefined.
--version
Show version information.
EXIT STATUS
ocamlformat-rpc exits with:
0 on success.
123 on indiscriminate errors reported on standard error.
124 on command line parsing errors.
125 on unexpected internal errors (bugs).
v}