-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Javier Chávarri <[email protected]>
- Loading branch information
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
open Import | ||
|
||
let term = | ||
let+ builder = Common.Builder.term in | ||
let common, config = Common.init builder in | ||
Scheduler.go ~common ~config | ||
@@ fun () -> | ||
let open Fiber.O in | ||
let* setup = Import.Main.setup () in | ||
let+ setup = Memo.run setup in | ||
let ctxts = | ||
List.map | ||
~f:(fun (name, _) -> Context_name.to_string name) | ||
(Context_name.Map.to_list setup.scontexts) | ||
in | ||
List.iter ctxts ~f:print_endline | ||
;; | ||
|
||
let command = | ||
let doc = "prints information about the available Dune contexts." in | ||
let info = Cmd.info ~doc "contexts" in | ||
Cmd.v info term | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
open Import | ||
|
||
(** Dune command to print out the defined Dune contexts.*) | ||
val command : unit Cmd.t |
19 changes: 19 additions & 0 deletions
19
test/blackbox-tests/test-cases/describe/describe-contexts.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Showcase behavior of the `dune describe contexts` subcommand | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.14) | ||
> EOF | ||
|
||
$ cat > dune-workspace << EOF | ||
> (lang dune 3.14) | ||
> | ||
> (context default) | ||
> | ||
> (context | ||
> (default | ||
> (name alt))) | ||
> EOF | ||
|
||
$ dune describe contexts | ||
alt | ||
default |