Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unixjunkie/minicli
Minimalist OCaml library for command line parsing
https://github.com/unixjunkie/minicli
cli command-line-interface command-line-parsing minimalist ocaml-library
Last synced: 23 days ago
JSON representation
Minimalist OCaml library for command line parsing
- Host: GitHub
- URL: https://github.com/unixjunkie/minicli
- Owner: UnixJunkie
- License: other
- Created: 2017-08-15T08:53:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T06:59:40.000Z (about 4 years ago)
- Last Synced: 2024-10-15T07:11:14.300Z (about 1 month ago)
- Topics: cli, command-line-interface, command-line-parsing, minimalist, ocaml-library
- Language: OCaml
- Homepage:
- Size: 27.3 KB
- Stars: 31
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Minicli
Minimalist OCaml library for command line parsing.
Look into the test.ml file for usage examples/quickstart.> "Minicli: because the UNIX command-line is to the computer scientist
> what latin and greek are to the linguist"# Example session with the test program
# _build/default/test.exe
usage:
_build/default/test.exe {-i|--input} {-o|--output} -n -x [-v] [--hi ]# _build/default/test.exe -i
Fatal error: exception Minicli__CLI.No_param_for_option("-i")# _build/default/test.exe -i input.txt
Fatal error: exception Minicli__CLI.Option_is_mandatory("-o")# _build/default/test.exe -i input.txt -o output.txt
Fatal error: exception Minicli__CLI.Option_is_mandatory("-n")# _build/default/test.exe -i input.txt -o output.txt -n /dev/null
Fatal error: exception Minicli__CLI.Not_an_int("/dev/null")# _build/default/test.exe -i input.txt -o output.txt -n 123
Fatal error: exception Minicli__CLI.Option_is_mandatory("-x")# _build/default/test.exe -i input.txt -o output.txt -n 123 -x /dev/null
Fatal error: exception Minicli__CLI.Not_a_float("/dev/null")# _build/default/test.exe -i input.txt -o output.txt -n 123 -x 0.123
i: input.txt o: output.txt n: 123 x: 0.123000 v: false# _build/default/test.exe -i input.txt -o output.txt -n 123 -x 0.123 -v
i: input.txt o: output.txt n: 123 x: 0.123000 v: true# _build/default/test.exe -i input.txt -o output.txt -n 123 -x 0.123 -v -i input.bin
Fatal error: exception Minicli__CLI.More_than_once("-i, --input")# _build/default/test.exe --toto titi -i input.txt -o output.txt -n 123 -x 0.123 -v -y 42
Fatal error: exception Minicli__CLI.Unused_options("--toto,-y")# Bibliography
Stephenson, N. (1999). In the beginning... was the command line. New York: Avon books.