Skip to content

Commit

Permalink
dry-run: display $( ... )
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed Sep 2, 2021
1 parent a151ba4 commit 57f6481
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/runner.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module Dry_run = struct

let run_out ?extra_env cmd =
Format.printf "Run_out: %a%a\n" pp_env extra_env pp_cmd cmd;
Ok "output"
Format.kasprintf Rresult.R.ok "$(%a%a)" pp_env extra_env pp_cmd cmd
end

let dry_run =
Expand Down
8 changes: 4 additions & 4 deletions test/cram/configure.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ Configure calls configure with the right prefix.

$ opam-compiler configure --dry-run
Run_out: OPAMCLI=2.0 opam config var prefix
Run: ./configure --prefix output
Run: ./configure --prefix "$(OPAMCLI=2.0 opam config var prefix)"

Anything after -- is passed to the configure command.

$ opam-compiler configure --dry-run -- --xxx --yyy
Run_out: OPAMCLI=2.0 opam config var prefix
Run: ./configure --prefix output --xxx --yyy
Run: ./configure --prefix "$(OPAMCLI=2.0 opam config var prefix)" --xxx --yyy

Shorthand versions are supported.

$ opam-compiler configure --dry-run --with afl
Run_out: OPAMCLI=2.0 opam config var prefix
Run: ./configure --prefix output --with-afl
Run: ./configure --prefix "$(OPAMCLI=2.0 opam config var prefix)" --with-afl

It is possible to mix both.

$ opam-compiler configure --dry-run --with afl -- --xxx --yyy
Run_out: OPAMCLI=2.0 opam config var prefix
Run: ./configure --prefix output --with-afl --xxx --yyy
Run: ./configure --prefix "$(OPAMCLI=2.0 opam config var prefix)" --with-afl --xxx --yyy

0 comments on commit 57f6481

Please sign in to comment.