Skip to content

Commit

Permalink
Fix placeholders in dune subst documentation
Browse files Browse the repository at this point in the history
They were substituted, leading to confusing documentation.

Signed-off-by: Etienne Millon <me@emillon.org>
  • Loading branch information
emillon committed Aug 2, 2018
1 parent b05e285 commit 9dbf57e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ next
- Add `(staged_pps ...)` to support staged ppx rewriters such as ones
using the OCaml typer like `ppx_import` (#1080, fix #193, @diml)

- Fix placeholders in `dune subst` documentation (#1090, @emillon, thanks
@trefis for the bug report)

1.0.1 (19/07/2018)
------------------

Expand Down
16 changes: 10 additions & 6 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,10 @@ let exec =
in
(term, Term.info "exec" ~doc ~man)

(** A string that is "%%VERSION%%" but not expanded by [dune subst] *)
let literal_version =
"%%" ^ "VERSION%%"

let subst =
let doc =
"Substitute watermarks in source files."
Expand All @@ -1294,17 +1298,17 @@ let subst =
[ `S "DESCRIPTION"
; `P {|Substitute $(b,%%ID%%) strings in source files, in a similar fashion to
what topkg does in the default configuration.|}
; `P {|This command is only meant to be called when a user pins a package to
its development version. Especially it replaces $(b,%%VERSION%%) strings
by the version obtained from the vcs. Currently only git is supported and
the version is obtained from the output of:|}
; `P ({|This command is only meant to be called when a user pins a package to
its development version. Especially it replaces $(b,|} ^ literal_version
^{|) strings by the version obtained from the vcs. Currently only git is
supported and the version is obtained from the output of:|})
; `Pre {| \$ git describe --always --dirty|}
; `P {|$(b,dune subst) substitutes the variables that topkg substitutes with
the defatult configuration:|}
; var "NAME" "the name of the project (from the dune-project file)"
; var "VERSION" "output of $(b,git describe --always --dirty)"
; var "VERSION_NUM" "same as $(b,%%VERSION%%) but with a potential leading \
'v' or 'V' dropped"
; var "VERSION_NUM" ("same as $(b," ^ literal_version ^
") but with a potential leading 'v' or 'V' dropped")
; var "VCS_COMMIT_ID" "commit hash from the vcs"
; opam "maintainer"
; opam "authors"
Expand Down

0 comments on commit 9dbf57e

Please sign in to comment.