Skip to content

Commit

Permalink
describe: move dummy --lang argument into own module
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Caglayan <alizter@gmail.com>
  • Loading branch information
Alizter committed Jun 10, 2023
1 parent 934b3a7 commit def9d80
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 25 deletions.
9 changes: 1 addition & 8 deletions bin/describe/describe_external_lib_deps.ml
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,7 @@ let to_dyn context_name external_resolved_libs =
let term =
let+ common = Common.term
and+ context_name = Common.context_arg ~doc:"Build context to use."
and+ _ =
Arg.(
value
& opt (some string) None
& info [ "lang" ] ~docv:"VERSION"
~doc:
"This argument has no effect and is deprecated. It exists solely \
for backwards compatibility.")
and+ _ = Describe_lang_compat.arg
and+ format = Describe_format.arg in
let config = Common.init common in
Scheduler.go ~common ~config @@ fun () ->
Expand Down
8 changes: 8 additions & 0 deletions bin/describe/describe_lang_compat.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
let arg =
Arg.(
value
& opt (some string) None
& info [ "lang" ] ~docv:"VERSION"
~doc:
"This argument has no effect and is deprecated. It exists solely for \
backwards compatibility.")
5 changes: 5 additions & 0 deletions bin/describe/describe_lang_compat.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(** Dune describe commands used to take a --lang arugment that did nothing
expect for dune describe workspace. To keep compatilbility with accepting
such an argument we provide a dummy argument here that can be used. It's
value will typically be ignored. *)
val arg : string option Cmdliner.Term.t
10 changes: 1 addition & 9 deletions bin/describe/describe_opam_files.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ open Stdune
let term =
let+ common = Common.term
and+ format = Describe_format.arg
and+ _ =
Arg.(
value
& opt (some string) None
& info [ "lang" ] ~docv:"VERSION"
~doc:
"This argument has no effect and is deprecated. It exists solely \
for backwards compatibility.")
in
and+ _ = Describe_lang_compat.arg in
let config = Common.init common in
Scheduler.go ~common ~config @@ fun () ->
Build_system.run_exn @@ fun () ->
Expand Down
9 changes: 1 addition & 8 deletions bin/describe/describe_pp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,7 @@ let get_pped_file super_context file =
let term =
let+ common = Common.term
and+ context_name = Common.context_arg ~doc:"Build context to use."
and+ _ =
Arg.(
value
& opt (some string) None
& info [ "lang" ] ~docv:"VERSION"
~doc:
"This argument has no effect and is deprecated. It exists solely \
for backwards compatibility.")
and+ _ = Describe_lang_compat.arg
and+ file =
Arg.(required & pos 0 (some string) None (Arg.info [] ~docv:"FILE"))
in
Expand Down

0 comments on commit def9d80

Please sign in to comment.