The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add test_shell.ml

To help with testing dir/file/path completions (#238).

+35 -1
+1
vendor/opam/cmdliner/B0.ml
··· 26 26 27 27 let testing = `File ~/"test/testing_cmdliner.ml" 28 28 29 + let test_shell = test ~/"test/test_shell.ml" ~run:false 29 30 let test_arg = test ~/"test/test_arg.ml" ~srcs:[testing] ~requires:[b0_std] 30 31 let test_cmd = test ~/"test/test_cmd.ml" ~srcs:[testing] ~requires:[b0_std] 31 32 let test_completion =
+4 -1
vendor/opam/cmdliner/DEVEL.md
··· 18 18 19 19 This replaces the generic completion function used by tool completion 20 20 scripts with the new definition. Trying to complete tools should now 21 - use the new definitions. 21 + use the new definitions. To test the file, directory and path completions 22 + you can also use this test (invoke with `--help`) 23 + 24 + b0 -- test_shell 22 25 23 26 If you change completion scripts in [`src/tool`](src/tool) you must invoke: 24 27
+30
vendor/opam/cmdliner/test/test_shell.ml
··· 1 + (*--------------------------------------------------------------------------- 2 + Copyright (c) 2025 The cmdliner programmers. All rights reserved. 3 + SPDX-License-Identifier: ISC 4 + ---------------------------------------------------------------------------*) 5 + 6 + (* Use to test for completion interactively. *) 7 + 8 + let tool ~file ~dir ~path = 9 + print_endline "Happy?"; 10 + Cmdliner.Cmd.Exit.ok 11 + 12 + open Cmdliner 13 + open Cmdliner.Term.Syntax 14 + 15 + let cmd = 16 + Cmd.make (Cmd.info "test_shell" ~version:"%%VERSION%%") @@ 17 + let+ file = 18 + let doc = "Use me to test for filepath completion." in 19 + Arg.(value & opt (some filepath) None & info ["file"] ~doc) 20 + and+ dir = 21 + let doc = "Use me to test for dirpath completion." in 22 + Arg.(value & opt (some dirpath) None & info ["dir"] ~doc) 23 + and+ path = 24 + let doc = "Use me to test for path completion." in 25 + Arg.(value & opt (some path) None & info ["path"] ~doc) 26 + in 27 + tool ~file ~dir ~path 28 + 29 + let main () = Cmd.eval' cmd 30 + let () = if !Sys.interactive then () else exit (main ())