1DUNE-SUBST(1) Dune Manual DUNE-SUBST(1)
2
3
4
6 dune-subst - Substitute watermarks in source files.
7
9 dune subst [OPTION]...
10
12 Substitute %%ID%% strings in source files, in a similar fashion to what
13 topkg does in the default configuration.
14
15 This command is only meant to be called when a user pins a package to
16 its development version. Especially it replaces %%VERSION%% strings by
17 the version obtained from the vcs. Currently only git is supported and
18 the version is obtained from the output of:
19
20 $ git describe --always --dirty
21
22 dune subst substitutes the variables that topkg substitutes with the
23 default configuration:
24 - %%NAME%%, the name of the project (from the dune-project file)
25 - %%VERSION%%, output of git describe --always --dirty
26 - %%VERSION_NUM%%, same as %%VERSION%% but with a potential leading 'v'
27 or 'V' dropped
28 - %%VCS_COMMIT_ID%%, commit hash from the vcs
29 - %%PKG_MAINTAINER%%, contents of the maintainer: field from the opam
30 file
31 - %%PKG_AUTHORS%%, contents of the authors: field from the opam file
32 - %%PKG_HOMEPAGE%%, contents of the homepage: field from the opam file
33 - %%PKG_ISSUES%%, contents of the issues: field from the opam file
34 - %%PKG_DOC%%, contents of the doc: field from the opam file
35 - %%PKG_LICENSE%%, contents of the license: field from the opam file
36 - %%PKG_REPO%%, contents of the repo: field from the opam file
37
38 In order to call dune subst when your package is pinned, add this line
39 to the build: field of your opam file:
40
41 [dune "subst"] {pinned}
42
43 Note that this command is meant to be called only from opam files and
44 behaves a bit differently from other dune commands. In particular it
45 doesn't try to detect the root and must be called from the root of the
46 project.
47
49 --build-info
50 Show build information.
51
52 --help[=FMT] (default=auto)
53 Show this help in format FMT. The value FMT must be one of `auto',
54 `pager', `groff' or `plain'. With `auto', the format is `pager` or
55 `plain' whenever the TERM env var is `dumb' or undefined.
56
57 --version
58 Show version information.
59
61 These options are common to all commands.
62
63 --debug-backtraces
64 Always print exception backtraces.
65
67 Use `dune COMMAND --help' for help on a single command.
68
70 Check bug reports at https://github.com/ocaml/dune/issues
71
72
73
74Dune n/a DUNE-SUBST(1)