diff --git a/dev/linol-lwt/Linol_lwt/.dune-keep b/.nojekyll
similarity index 100%
rename from dev/linol-lwt/Linol_lwt/.dune-keep
rename to .nojekyll
diff --git a/_config.yml b/_config.yml
deleted file mode 100644
index 2f7efbea..00000000
--- a/_config.yml
+++ /dev/null
@@ -1 +0,0 @@
-theme: jekyll-theme-minimal
\ No newline at end of file
diff --git a/_odoc-theme/fonts/DejaVuSansMono-Bold.woff2 b/_odoc-theme/fonts/DejaVuSansMono-Bold.woff2
new file mode 100644
index 00000000..f2b469a6
Binary files /dev/null and b/_odoc-theme/fonts/DejaVuSansMono-Bold.woff2 differ
diff --git a/_odoc-theme/fonts/DejaVuSansMono-BoldOblique.woff2 b/_odoc-theme/fonts/DejaVuSansMono-BoldOblique.woff2
new file mode 100644
index 00000000..c28f9107
Binary files /dev/null and b/_odoc-theme/fonts/DejaVuSansMono-BoldOblique.woff2 differ
diff --git a/_odoc-theme/fonts/DejaVuSansMono-Oblique.woff2 b/_odoc-theme/fonts/DejaVuSansMono-Oblique.woff2
new file mode 100644
index 00000000..2631692e
Binary files /dev/null and b/_odoc-theme/fonts/DejaVuSansMono-Oblique.woff2 differ
diff --git a/_odoc-theme/fonts/DejaVuSansMono.woff2 b/_odoc-theme/fonts/DejaVuSansMono.woff2
new file mode 100644
index 00000000..cf200e12
Binary files /dev/null and b/_odoc-theme/fonts/DejaVuSansMono.woff2 differ
diff --git a/_odoc-theme/fonts/PTC55F.woff2 b/_odoc-theme/fonts/PTC55F.woff2
new file mode 100644
index 00000000..aa67b386
Binary files /dev/null and b/_odoc-theme/fonts/PTC55F.woff2 differ
diff --git a/_odoc-theme/fonts/PTC75F.woff2 b/_odoc-theme/fonts/PTC75F.woff2
new file mode 100644
index 00000000..fa5a500e
Binary files /dev/null and b/_odoc-theme/fonts/PTC75F.woff2 differ
diff --git a/_odoc-theme/fonts/PTS55F.woff2 b/_odoc-theme/fonts/PTS55F.woff2
new file mode 100644
index 00000000..0aef8b14
Binary files /dev/null and b/_odoc-theme/fonts/PTS55F.woff2 differ
diff --git a/_odoc-theme/fonts/PTS56F.woff2 b/_odoc-theme/fonts/PTS56F.woff2
new file mode 100644
index 00000000..2fd9d9af
Binary files /dev/null and b/_odoc-theme/fonts/PTS56F.woff2 differ
diff --git a/_odoc-theme/fonts/PTS75F.woff2 b/_odoc-theme/fonts/PTS75F.woff2
new file mode 100644
index 00000000..a0fa7de3
Binary files /dev/null and b/_odoc-theme/fonts/PTS75F.woff2 differ
diff --git a/_odoc-theme/fonts/PTS76F.woff2 b/_odoc-theme/fonts/PTS76F.woff2
new file mode 100644
index 00000000..8cae8e79
Binary files /dev/null and b/_odoc-theme/fonts/PTS76F.woff2 differ
diff --git a/_odoc-theme/fonts/fonts.css b/_odoc-theme/fonts/fonts.css
new file mode 100644
index 00000000..9bffe8e8
--- /dev/null
+++ b/_odoc-theme/fonts/fonts.css
@@ -0,0 +1,59 @@
+@charset "UTF-8";
+
+/* PT Sans */
+
+@font-face
+{ font-family: 'PT-Sans';
+ src: url('PTS55F.woff2') format('woff2');
+ font-weight: 400; font-style: normal; }
+
+@font-face
+{ font-family: 'PT-Sans';
+ src: url('PTS75F.woff2') format('woff2');
+ font-weight: 700; font-style: normal; }
+
+@font-face
+{ font-family: 'PT-Sans';
+ src: url('PTS56F.woff2') format('woff2');
+ font-weight: 400; font-style: italic; }
+
+@font-face
+{ font-family: 'PT-Sans';
+ src: url('PTS76F.woff2') format('woff2');
+ font-weight: 700; font-style: italic; }
+
+/* PT Sans caption */
+
+@font-face
+{ font-family: 'PT-Sans-Caption';
+ src: url('PTC55F.woff2') format('woff2');
+ font-weight: 400; font-style: normal; }
+
+@font-face
+{ font-family: 'PT-Sans-Caption';
+ src: url('PTC75F.woff2') format('woff2');
+ font-weight: 700; font-style: normal; }
+
+/* DejaVu 400 */
+
+@font-face
+{ font-family: 'DejaVu-SansMono';
+ src: url('DejaVuSansMono.woff2') format('woff2');
+ font-weight: 400; font-style: normal; }
+
+@font-face
+{ font-family: 'DejaVu-SansMono';
+ src: url('DejaVuSansMono-Oblique.woff2') format('woff2');
+ font-weight: 400; font-style: oblique; }
+
+/* DejaVu 700 */
+
+@font-face
+{ font-family: 'DejaVu-SansMono';
+ src: url('DejaVuSansMono-Bold.woff2') format('woff2');
+ font-weight: 700; font-style: normal; }
+
+@font-face
+{ font-family: 'DejaVu-SansMono';
+ src: url('DejaVuSansMono-BoldOblique.woff2') format('woff2');
+ font-weight: 700; font-style: oblique; }
diff --git a/_odoc-theme/manual.css b/_odoc-theme/manual.css
new file mode 100644
index 00000000..92a1b438
--- /dev/null
+++ b/_odoc-theme/manual.css
@@ -0,0 +1,376 @@
+@charset "UTF-8";
+@import url("fonts/fonts.css");
+@import url("theme.css");
+
+/* Copyright (c) 2019 The odig programmers. All rights reserved.
+ Distributed under the ISC license, see terms at the end of the file.
+ odig v0.0.9 */
+
+:root { --font-headings: "PT-Sans-Caption";
+ --font-body: "PT-Sans";
+ --font-mono: "DejaVu-SansMono";
+
+ --size-font: 0.96875rem;
+ --size-font-micro: calc(0.675 * var(--size-font));
+ --size-font-tiny-ratio: 0.75;
+ --size-font-tiny: calc(var(--size-font-tiny-ratio) * var(--size-font));
+ --size-font-small: calc(0.875 * var(--size-font));
+ --size-font-large: calc(1.25 * var(--size-font));
+ --size-font-big: calc(1.5 * var(--size-font));
+ --size-font-huge: calc(1.75 * var(--size-font));
+ --size-font-mono-ratio: 0.87097;
+ --size-line-ratio: 1.5;
+ --size-line: calc(var(--size-line-ratio) * var(--size-font));
+ --size-half-line: calc(0.5 * var(--size-line)); }
+
+/* Reset a few things. */
+
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,
+a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,select,
+small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,
+fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,
+article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,
+menu,nav,output,ruby,section,summary,time,mark,audio,video,button,input
+{ margin: 0; padding: 0; border: 0; /* outline: 0; */
+ font-size: inherit; font: inherit; font-weight: inherit;
+ line-height: inherit; vertical-align: baseline;
+ text-align: inherit; color: inherit; background: transparent; }
+
+table { border-collapse: collapse; border-spacing: 0; }
+*, *:before, *:After { box-sizing: border-box; }
+
+/* Note the stylesheet has quite hackish CSS selectors as the markup's
+ classification is sometimes a bit lacking. */
+
+/* Geometry.
+ See also media adjustements at the end of the stylesheet. */
+
+body { background-color: var(--color-bg);
+ color: var(--color-fg);
+ font-size: var(--size-font);
+ font-family: var(--font-body), sans-serif;
+ font-weight: 400;
+ line-height: var(--size-line);
+ text-align: left;
+ position: relative;
+ max-width: 120ch;
+ margin: 0 auto;
+ padding: calc(1.5 * var(--size-line));
+ padding-top: calc(0.5 * var(--size-line)); }
+
+body > * { max-width: 80ch; width: 75% }
+body > ul:first-of-type:not(.itemize):not(.ftoc2) /* toc */
+{ position: absolute;
+ top: 0px; right: 0px;
+ width: 20%;
+ margin-left: var(--size-line);
+ margin-top: calc(2 * var(--size-line));
+ margin-right: var(--size-line);
+ border-top: solid thin var(--color-rule); }
+
+/* Rules
+ We remove the top one, keep the last one and add one over h1 and h2 */
+
+body > hr:last-of-type {
+ margin-top: var(--size-line);
+ border-style: none;
+ width: 100%;
+ max-width: 100%;
+ text-align: right;
+ border-top: solid thin var(--color-rule); }
+
+body > hr:first-of-type { display: none } /* order with last-of-type imporant */
+h1, h2 { border-top: solid thin var(--color-rule) }
+
+/* Hacks */
+
+body > a > img /* Navigation arrows, a bit problematic for dark themes */
+{ display: inline-block; margin:0;
+ background-color: var(--color-code-block-bg); /* bof */ }
+
+body > p br, h1 br { display: none; } /* brs should die */
+
+/* Basic markup */
+
+h1, h2, h3, h4, h5, h6
+{ font-family: var(--font-headings), sans-serif;
+ font-weight: 400;
+ text-transform: uppercase;
+ margin-top: var(--size-line); }
+
+h1, h2 { line-height: calc(1.5 * var(--size-line));
+ padding-top: calc(0.75 * var(--size-line)); }
+
+hr + h1, hr + h2 { margin-top: calc(0.25 * var(--size-line)) }
+
+h1 { font-size: var(--size-font-huge); }
+h2 { font-size: var(--size-font-big); }
+h3 { font-size: var(--size-font-large); }
+
+div, nav, p, ol, ul, dl, pre, table, blockquote
+{ margin-top: var(--size-half-line); }
+
+ul, ol { list-style-position: outside }
+ul { list-style-type: square }
+ul > li { margin-left: 2.25ch; }
+ol > li { margin-left: 2ch; }
+
+em { font-style: italic }
+b, strong { font-weight: 700 }
+small { font-size: var(--size-font-small); }
+
+sup { vertical-align: super; }
+sub { vertical-align: sub; }
+sup, sub { font-size : calc(1em * var(--size-font-tiny-ratio));
+ line-height: 0; margin-left: 0.2ex; }
+
+img { display: block;
+ margin-top: var(--size-half-line); margin-bottom: var(--size-half-line); }
+
+blockquote { margin-left: var(--size-half-line); }
+
+/* Links and anchors. Note anchors need to be refined a bit further down
+ in certain cases. */
+
+a { text-decoration:none; color: var(--color-link); }
+a:hover { box-shadow:0 1px 0 0 var(--color-link); }
+a.anchor:before { content: "#" }
+a.anchor:hover { box-shadow: none; text-decoration: underline; }
+*:hover > a.anchor { visibility: visible }
+a.anchor
+{ visibility: hidden; position: absolute;
+ font-weight: normal;
+ font-style: normal;
+ margin-left: -2.5ch;
+ padding-right: 1ch; padding-left: 1ch; /* To remain selectable */
+ color: var(--color-link);
+ text-align: right;
+ }
+
+*:target /* Linked highlight */
+{ background-color: var(--color-bg-highlight);
+ box-shadow: 0 0 0 3px var(--color-bg-highlight) }
+
+/* Code and code highlighting */
+
+.c003, .c004, .c005, .c006, .c015,
+code, pre
+{ font-family: var(--font-mono), monospace;
+ font-weight: 400;
+ font-size: calc(1em * var(--size-font-mono-ratio));
+ color: var(--color-code-fg); }
+
+.c004, .c002 { color: var(--color-code-type-id); }
+.c005 { font-style: oblique }
+.c006 { font-weight: 700 }
+.c015 { text-align: left }
+
+pre .c003, pre .c004, pre .c005, pre .c006,
+pre code { font-size: inherit } /* don't apply transform twice... */
+a code { color: inherit }
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { text-transform: none; }
+
+pre { background: var(--color-code-block-bg);
+ padding-left: 0.8ch; padding-right: 0.8ch;
+ margin-left: -0.8ch; margin-right: -0.8ch;
+ padding-top: 1ch; padding-bottom: 1ch;
+ white-space: pre-wrap;
+ word-wrap: break-word; }
+
+/* Table of contents, like in odoc.css except we don't have a class */
+
+body > ul:first-of-type:not(.itemize):not(.ftoc2)
+{ font-size: var(--size-font-small); }
+
+body > ul:first-of-type:not(.itemize):not(.ftoc2) a
+{ color : var(--color-fg); }
+
+body > ul:first-of-type:not(.itemize):not(.ftoc2) a:hover
+{ color : var(--color-link); }
+
+body > ul:first-of-type:not(.itemize):not(.ftoc2)
+{ font-family: var(--font-headings); text-transform: uppercase;
+ list-style-type: none; padding-top: var(--size-line) }
+
+body > ul:first-of-type:not(.itemize):not(.ftoc2) li
+{ margin-left: 0; padding-left: 3.25ch; text-indent: -3.25ch; }
+
+body > ul:first-of-type:not(.itemize):not(.ftoc2) ul
+{ font-family: var(--font-body);
+ text-transform: none;
+ margin-top:0; }
+
+/* toplevel examples */
+
+div.caml-example.toplevel div.caml-input::before { content: "#" }
+div.caml-input, div.caml-output { margin-top: 0; }
+
+.caml-input {}
+.caml-output { color: var(--color-code-string) /* why not */ }
+
+/* Other HeVeA classes */
+
+.c000 { border-spacing: 2ch; border-collapse: separate; margin: 0 auto; }
+.c001 { border-spacing: 1ch; border-collapse: separate }
+.c008 { font-size: var(--size-font-small) }
+.c009 { font-style:italic }
+.c010 { font-style:italic; color:var(--color-link) }
+.c011 { font-style:italic; font-weight:700 }
+.c012 { font-style:italic }
+.c013 { font-style:italic }
+.c018 { text-align: right }
+.c019 { text-align: left}
+.dcenter { margin: 0 auto; }
+.description { margin-left: var(--size-line) }
+.dd-description br { display: none }
+dd + dt { margin-top: var(--size-half-line) }
+
+dt .c003 { font-style:normal; font-weight:700 } /* options */
+
+.indexenv { list-style-type: none }
+.indexenv li { margin-left: 0 }
+
+/* Page specific */
+
+/* Cover page */
+
+div.maintitle > span > span
+{ text-transform: uppercase;
+ font-family: var(--font-headings);
+ line-height: var(--size-line-ratio);
+ font-size: calc(2.25 * var(--size-font)) !important;
+ margin-left: -0.25ch; /* compensate nbsp */ }
+
+div.maintitle > span > span > br { display: none }
+div.maintitle > span > span > span
+{ display: block;
+ text-transform: none;
+ font-style: italic;
+ font-family: var(--font-body);
+ font-size: var(--size-font-big) !important; }
+
+div.maintitle > span > span > span > span /* ugh */
+{ font-style: normal;
+ line-height: var(--size-line);
+ font-size: var(--size-font) !important; }
+
+div.maintitle > span > span > span > span > span /* ugh bis */
+{ font-size: var(--size-font-small) !important;
+ font-style: italic;
+ margin-left: -1.25ch; }
+
+div.maintitle + blockquote hr { display : none }
+div.maintitle + blockquote
+{ margin: 0;
+/* margin-top: calc(-1 * var(--size-line)); chrome but not FF, bah... */
+ font-size: var(--size-font-small);
+ border-bottom: solid thin var(--color-rule);
+ padding-bottom: var(--size-half-line); }
+
+div.maintitle ~ blockquote:last-of-type { display: none } /* remove branding */
+
+div.maintitle ~ ul:first-of-type:not(.itemize):not(.ftoc2) /* undo side toc */
+{ position: static;
+ padding: 0;
+ margin: 0; margin-top: var(--size-line);
+ width: 100%; }
+
+div.maintitle ~ br { display: none }
+div.maintitle ~ ul:first-of-type:not(.itemize):not(.ftoc2) > li { margin: 0; }
+div.maintitle ~ ul:first-of-type:not(.itemize):not(.ftoc2) a
+{ color: var(--color-link) }
+
+div.maintitle ~ table { margin-top: 0 }
+div.maintitle ~ ul:first-of-type:not(.itemize):not(.ftoc2)
+{ list-style-type: none;
+ font-family: inherit; text-transform: inherit;
+ font-size: inherit;
+ margin-top: var(--size-half-line);
+ border: none; }
+
+div.maintitle ~ ul { list-style-type: none }
+div.maintitle ~ ul li { margin-left: 0 }
+
+/* Contents page */
+
+h1#sec1 + ul:first-of-type /* undo side toc */
+{ position: static;
+ list-style-type: none;
+ margin: 0; margin-top: var(--size-half-line);
+ width: 100%; border: none; padding: 0;
+ font-size: var(--size-font-big); }
+
+h1#sec1 + ul:first-of-type li
+{ margin-left: 0; padding-left: 0; text-indent: 0 }
+
+h1#sec1 ~ ul ul
+{ list-style-type: none; font-size: var(--size-font-large); font-style: italic;}
+
+h1#sec1 ~ ul ul ul
+{ font-size: var(--size-font); font-style: normal;
+ margin-top: var(--size-half-line); }
+
+h1#sec1 ~ ul ul ul ul { margin-left: 2.5ch; margin-top: 0;}
+h1#sec1 ~ ul > li { margin-top: var(--size-line); }
+h1#sec1 ~ ul > li > ul > li { margin-top: var(--size-half-line); }
+
+/* Media adjustments */
+
+@media only screen and (min-width:160ch) /* and (min-height: 60rem) */
+{
+:root { --size-font: 1.125rem; } /* consider using vmin units */
+}
+
+@media only screen and (max-width:80ch)
+{
+ body { padding: var(--size-line); }
+ body > * { width: 100%; }
+ body > ul:first-of-type:not(.itemize):not(.ftoc2)
+ { position: static;
+ margin: 0; margin-top: var(--size-line);
+ width: 100%; }
+ pre { font-size: var(--size-font-tiny); }
+}
+
+@media print
+{
+ * { -webkit-print-color-adjust: exact; }
+ .content nav:first-child { visibility: hidden }
+ body > * { width: 100%; }
+ body > ul:first-of-type:not(.itemize):not(.ftoc2)
+ { position: static; width: 100%;
+ margin: 0; margin-top: var(--size-line); }
+
+ /* odig.light with slight adjustements */
+ :root
+ { --color-bg: white;
+ --color-bg-highlight: #CAD7EF;
+ --color-fg: black;
+ --color-rule: #DADBDB;
+
+ --color-code-block-bg: #E8E8E8;
+ --color-code-fg: #16191D;
+ --color-code-comment: #747679;
+ --color-code-keyword: #874aa9;
+ --color-code-type-id: #a9874a;
+ --color-code-string: #4aa987;
+
+ --color-link: #557dcc;
+ --color-broken-link: #f71414; }
+}
+
+/*
+Copyright (c) 2019 The odig programmers
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
diff --git a/_odoc-theme/odoc.css b/_odoc-theme/odoc.css
new file mode 100644
index 00000000..1dbc9da2
--- /dev/null
+++ b/_odoc-theme/odoc.css
@@ -0,0 +1,334 @@
+@charset "UTF-8";
+@import url("fonts/fonts.css");
+@import url("theme.css");
+
+/* Copyright (c) 2019 The odig programmers. All rights reserved.
+ Distributed under the ISC license, see terms at the end of the file. */
+
+/* Reset a few things. */
+
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,
+a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,select,
+small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,
+fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,
+article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,
+menu,nav,output,ruby,section,summary,time,mark,audio,video,button,input
+{ margin: 0; padding: 0; border: 0; /* outline: 0; */
+ font-size: inherit; font: inherit; font-weight: inherit;
+ line-height: inherit; vertical-align: baseline;
+ text-align: inherit; color: inherit; background: transparent; }
+
+table { border-collapse: collapse; border-spacing: 0; }
+*, *:before, *:after { box-sizing: border-box; }
+
+/* Basic geometry */
+
+:root { --font-headings: "PT-Sans-Caption";
+ --font-body: "PT-Sans";
+ --font-mono: "DejaVu-SansMono";
+ --size-font: 0.96875rem;
+ --size-font-micro: calc(0.675 * var(--size-font));
+ --size-font-tiny-ratio: 0.75;
+ --size-font-tiny: calc(var(--size-font-tiny-ratio) * var(--size-font));
+ --size-font-small: calc(0.875 * var(--size-font));
+ --size-font-large: calc(1.25 * var(--size-font));
+ --size-font-big: calc(1.5 * var(--size-font));
+ --size-font-huge: calc(1.75 * var(--size-font));
+ --size-font-mono-ratio: 0.87097;
+ --size-font-mono-ratio: 0.865;
+ --size-line-ratio: 1.5;
+ --size-line: calc(var(--size-line-ratio) * var(--size-font));
+ --size-half-line: calc(0.5 * var(--size-line));
+ --size-fourth-line: calc(0.25 * var(--size-line)); }
+
+.odoc { background-color: var(--color-bg);
+ color: var(--color-fg);
+ font-size: var(--size-font);
+ font-family: var(--font-body), sans-serif;
+ font-weight: 400;
+ line-height: var(--size-line);
+ text-align: left;
+ display: grid;
+ margin: 0 auto;
+ max-width: 130ch;
+ grid-template-columns: minmax(50ch,76ch) minmax(23ch,1fr);
+ grid-column-gap: calc(2 * var(--size-line));
+ grid-template-areas: "nav nav"
+ "header toc"
+ "content toc";
+ padding: calc(1.5 * var(--size-line));
+ padding-top: calc(0.5 * var(--size-line)); }
+
+.odoc-nav { grid-area: nav; }
+.odoc-preamble { grid-area: header; }
+.odoc-content { grid-area: content; margin: 0 }
+.odoc-toc
+{ grid-area: toc;
+ margin-top: var(--size-line);
+ border-top: solid thin var(--color-rule); }
+
+/* Media adjustments */
+
+@media only screen and (min-width:160ch) /* and (min-height: 60rem) */
+{
+ :root { --size-font: 1.125rem; } /* consider using vmin units */
+}
+
+@media only screen and (max-width:80ch) /* Basically mobile */
+{
+ .odoc
+ { padding: var(--size-line);
+ grid-template-columns: auto;
+ grid-template-rows: none;
+ grid-template-areas: "nav"
+ "header"
+ "toc"
+ "content"; }
+ .odoc-toc { margin: 0; margin-top: var(--size-line); }
+ pre { font-size: var(--size-font-tiny); }
+}
+
+@media print
+{
+ * { -webkit-print-color-adjust: exact; }
+ .odoc-nav { visibility: hidden }
+ .odoc-toc { margin: 0; margin-top: var(--size-line); }
+
+ /* odig.light with slight adjustements */
+ :root
+ { --color-bg: white;
+ --color-bg-highlight: #CAD7EF;
+ --color-fg: black;
+ --color-rule: #DADBDB;
+
+ --color-code-block-bg: #E8E8E8;
+ --color-code-fg: #16191D;
+ --color-code-comment: #747679;
+ --color-code-keyword: #874aa9;
+ --color-code-type-id: #a9874a;
+ --color-code-string: #4aa987;
+
+ --color-link: #557dcc;
+ --color-broken-link: #f71414; }
+}
+
+/* Block level markup */
+
+header > * + *, div > * + *, details > * + *
+{ margin-top: var(--size-half-line); }
+
+ul + * , ol + * { margin-top: 0; }
+ul, ol { margin-top: var(--size-fourth-line);
+ margin-bottom: var(--size-fourth-line);
+ list-style-position: outside; }
+
+li *:first-child, li ol, li ul { margin-top: 0; }
+
+ul { list-style-type: square; }
+ul > li { margin-left: 2.25ch; }
+ol > li { margin-left: 2ch; }
+ol li::marker
+{ font-family: var(--font-headings), sans-serif;
+ font-size: var(--size-font-small); }
+
+img
+{ display: block;
+ margin-top: var(--size-half-line);
+ margin-bottom: var(--size-half-line); }
+
+/* Headings and horizontal rulers */
+
+h1, h2, .odoc-content > *:first-child
+{ border-top: solid thin var(--color-rule);
+ padding-top: calc(0.75 * var(--size-line));
+ margin-top: var(--size-line); }
+
+h1, h2, h3, h4, h5, h6
+{ font-family: var(--font-headings), sans-serif;
+ font-weight: 400;
+ text-transform: uppercase;
+ margin-top: var(--size-line); }
+
+h1, h2 { line-height: calc(1.5 * var(--size-line)); }
+h1 { font-size: var(--size-font-huge); }
+h2 { font-size: var(--size-font-big); }
+h3 { font-size: var(--size-font-large); }
+
+/* Phrasing content */
+
+em { font-style: italic }
+b, strong { font-weight: 700 }
+small { font-size: var(--size-font-small); }
+
+sup { vertical-align: super; }
+sub { vertical-align: sub; }
+sup, sub
+{ font-size : calc(1em * var(--size-font-tiny-ratio));
+ line-height: 0; margin-left: 0.2ex; }
+
+/* Code and code highlighting */
+
+code, pre
+{ font-family: var(--font-mono), monospace;
+ font-weight: 400;
+ font-size: calc(1em * var(--size-font-mono-ratio));
+ color: var(--color-code-fg);
+ overflow-wrap: anywhere; }
+
+code span span { white-space: nowrap } /* Do not break these units */
+
+pre code { font-size: inherit } /* don't apply transform twice... */
+a code { color: inherit }
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { text-transform: none; }
+
+pre
+{ background: var(--color-code-block-bg);
+ padding-left: 0.8ch; padding-right: 0.8ch;
+ margin-left: -0.8ch; margin-right: -0.8ch;
+ padding-top: 1ch; padding-bottom: 1ch;
+ white-space: pre-wrap;
+ overflow-wrap: break-word; }
+
+.arrow { white-space: nowrap }
+.keyword , .hljs-keyword { color : var(--color-code-keyword); }
+.hljs-type { color : var(--color-code-type-id); }
+.hljs-string { color : var(--color-code-string); }
+.hljs-comment { color : var(--color-code-comment); font-style: italic; }
+
+/* Links and anchors. Note anchors need to be refined a bit further down
+ in certain cases. */
+
+a { text-decoration:none; color: var(--color-link); }
+a:hover { box-shadow:0 1px 0 0 var(--color-link); }
+a.anchor:before { content: "#" }
+a.anchor:hover { box-shadow: none; text-decoration: underline; }
+*:hover > a.anchor { visibility: visible }
+a.anchor
+{ visibility: hidden; position: absolute;
+ font-weight: normal;
+ font-style: normal;
+ margin-left: -2.5ch;
+ padding-right: 1ch; padding-left: 1ch; /* To remain selectable */
+ color: var(--color-link);
+ text-align: right; }
+
+*:target /* Linked highlight */
+{ background-color: var(--color-bg-highlight);
+ box-shadow: 0 0 0 3px var(--color-bg-highlight) }
+
+.xref-unresolved { box-shadow:0 1px 0 0 var(--color-broken-link)}
+
+/* Table of contents */
+
+.odoc-toc { font-size: var(--size-font-small); }
+.odoc-toc a { color : var(--color-fg); }
+.odoc-toc a:hover { color : var(--color-link) }
+.odoc-toc ul
+{ font-family: var(--font-headings); text-transform: uppercase;
+ margin-top: var(--size-line);
+ list-style-type: none; }
+
+.odoc-toc ul ul
+{ font-family: var(--font-body); text-transform: none; margin-top:0; }
+
+.odoc-toc ul ul ul { margin-left:1.5ch }
+.odoc-toc li { margin-left: 0; padding-left: 1ch; text-indent: -1ch; }
+.odoc-toc > ul > li { margin-top: calc(0.25 * var(--size-half-line)) }
+.odoc-toc > ul > li > ul > li:last-child
+{ margin-bottom: var(--size-half-line) }
+
+.odoc-toc ul ul li { margin-left: 0; padding-left: 0; }
+
+/* Module structure items */
+
+.odoc-spec { padding-bottom: var(--size-fourth-line); }
+.spec { margin-top: 0; }
+.spec-doc { margin-top:0; padding-left: 1ch; }
+.spec-doc > *:first-child { margin-top: 0 }
+
+/* Indent on wrap */
+.spec, .spec td:first-child { padding-left: 4ch; text-indent: -4ch }
+.spec td.field { padding-left: 6ch }
+
+.spec .def-doc .comment-delim + * { margin-top: 0 }
+.spec .def-doc .comment-delim /* make them invisible yet copy-pastable */
+{ position: absolute; width: 1px; height: 1px; overflow: hidden; }
+
+/* But we don't do it for types for now because of variants and
+ records. This makes :target highlight be off. And poses
+ other problems (e.g. need to indent back the last ] or }.
+ A better markup strategy should be found here. */
+.spec.type { padding-left: 0; text-indent: 0 }
+.spec.type > a.anchor
+{ padding-left: 1ch; padding-right: 1ch; /* values from a.anchor */ }
+.spec li > a.anchor, .spec > a.anchor
+{ padding-right: 0.5ch; padding-left: 2ch; }
+
+.spec ol { margin:0; list-style-type: none; }
+.spec li { margin-left: 0; padding-left: 4ch; text-indent: -4ch }
+.spec li.record.field { margin-left: 2ch }
+
+.spec .def-doc { display: inline-block }
+.spec .def-doc { padding-left: /* 4 + 3 */ 7ch; }
+.spec .def-doc p { margin-left: -4ch; text-indent: 0 }
+
+.odoc-include summary { cursor: pointer }
+
+/* Package, module and @tag lists
+
+ Allowing indent on wrap with the anchor makes all this quite convoluted.
+ Is there a better way ? */
+
+.packages, .modules, .at-tags { list-style-type: none; margin-left: -2ch; }
+.packages li, .modules li, .at-tags li { padding-left: 2ch; text-indent: -2ch; }
+.modules li a.anchor, .packages li a.anchor
+{ padding-right: 0.5ch; padding-left: 2ch; }
+
+.synopsis { padding-left: 1ch; }
+.version { font-size: var(--size-font-micro); }
+.at-tag { text-transform : capitalize }
+
+/* Package page */
+
+h1 .version, h1 nav { font-size: var(--size-font); line-height:0 }
+h1 nav
+{ display: inline-block;
+ font-family: var(--font-body);
+ text-transform: capitalize; }
+
+.package.info td:first-child { padding-right: 2ch; min-width: 13ch}
+.package.info ul { list-style-type: none; display: inline; margin:0; padding:0}
+.package.info li { display: inline-block; margin:0; margin-right:1ex; }
+#info-authors li, #info-maintainers li { display: block; }
+
+/* Package index page */
+
+.by-name nav a
+{ font-family: var(--font-headings);
+ font-size: var(--size-font-large);
+ text-transform: uppercase;
+ margin-right: 1ch;
+ display: inline-block; }
+
+.by-tag ol { list-style-type: none; }
+.by-tag ol.tags li { margin-left: 1ch; display: inline-block }
+.by-tag td:first-child
+{ font-family: var(--font-headings);
+ font-size: var(--size-font-large);
+ text-transform: uppercase; }
+
+/*
+Copyright (c) 2019 The odig programmers
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
diff --git a/_odoc-theme/theme.css b/_odoc-theme/theme.css
new file mode 100644
index 00000000..a7a8e6b8
--- /dev/null
+++ b/_odoc-theme/theme.css
@@ -0,0 +1,34 @@
+:root
+{ --color-bg: #F6F6F6;
+ --color-bg-highlight: #CAD7EF;
+ --color-fg: #1F2227;
+ --color-rule: #DADBDB;
+
+ --color-code-block-bg: #E8E8E8;
+ --color-code-fg: #16191D;
+ --color-code-comment: #747679;
+ --color-code-keyword: #874aa9;
+ --color-code-type-id: #a9874a;
+ --color-code-string: #4aa987;
+
+ --color-link: #557dcc;
+ --color-broken-link: #f71414; }
+
+@media (prefers-color-scheme: dark)
+{
+:root
+{ --color-bg: #181B20;
+ --color-bg-highlight: #303644;
+ --color-fg: #8C8D90;
+ --color-rule: #2F3236;
+
+ --color-code-block-bg: #24272A;
+ --color-code-fg: #A3A4A6;
+ --color-code-comment: #747679;
+ --color-code-keyword: #7F668D;
+ --color-code-type-id: #8D7F66;
+ --color-code-string: #668d7f;
+
+ --color-link: #7788AA;
+ --color-broken-link: #900505; }
+}
diff --git a/cmdliner/Cmdliner/Arg/index.html b/cmdliner/Cmdliner/Arg/index.html
new file mode 100644
index 00000000..5c663ecc
--- /dev/null
+++ b/cmdliner/Cmdliner/Arg/index.html
@@ -0,0 +1,31 @@
+
+
Arg (cmdliner.Cmdliner.Arg)
Module Cmdliner.Arg
Terms for command line arguments.
This module provides functions to define terms that evaluate to the arguments provided on the command line.
Basic constraints, like the argument type or repeatability, are specified by defining a value of type Arg.t. Further constraints can be specified during the conversion to a term.
Argument converters
An argument converter transforms a string argument of the command line to an OCaml value. Predefined converters are provided for many types of the standard library.
type'a parser = string ->[ `Ok of 'a| `Error of string ]
The type for argument parsers.
Deprecated. Use parser signatures of conv or conv'.
Warning. Do not use directly, use conv or conv'. This type will become abstract in the next major version of cmdliner.
val conv :
+ ?docv:string ->
+ ((string ->('a, [ `Msg of string ])result) * 'aprinter)->
+ 'aconv
conv ~docv (parse, print) is an argument converter parsing values with parse and printing them with print. docv is a documentation meta-variable used in the documentation to stand for the argument value, defaults to "VALUE".
Warning. Currently always returns "VALUE" in the future will return the value given to conv or conv'.
val parser_of_kind_of_string :
+ kind:string ->
+ (string ->'a option)->
+ string ->
+ ('a, [ `Msg of string ])result
parser_of_kind_of_string ~kind kind_of_string is an argument parser using the kind_of_string function for parsing and kind to report errors (e.g. could be "an integer" for an int parser.).
some' ?none c is like the converter c except it returns Some value. It is used for command line arguments that default to None when absent. If provided, none is used with conv's printer to document the value taken on absence; to document a more complex behaviour use the absent argument of info.
some ?none c is like some' but none is described as a string that will be rendered in bold.
Arguments and their information
Argument information defines the man page information of an argument and, for optional arguments, its names. An environment variable can also be specified to read the argument value from if the argument is absent from the command line and the variable is defined.
type'a t
The type for arguments holding data of type 'a.
type info
The type for information about command line arguments.
val info :
+ ?deprecated:string ->
+ ?absent:string ->
+ ?docs:string ->
+ ?docv:string ->
+ ?doc:string ->
+ ?env:Cmd.Env.info->
+ string list->
+ info
info docs docv doc env names defines information for an argument.
names defines the names under which an optional argument can be referred to. Strings of length 1 ("c") define short option names ("-c"), longer strings ("count") define long option names ("--count"). names must be empty for positional arguments.
env defines the name of an environment variable which is looked up for defining the argument if it is absent from the command line. See environment variables for details.
doc is the man page information of the argument. The documentation language can be used and the following variables are recognized:
"$(docv)" the value of docv (see below).
"$(opt)", one of the options of names, preference is given to a long one.
"$(env)", the environment var specified by env (if any).
docv is for positional and non-flag optional arguments. It is a variable name used in the man page to stand for their value.
docs is the title of the man page section in which the argument will be listed. For optional arguments this defaults to Manpage.s_options. For positional arguments this defaults to Manpage.s_arguments. However a positional argument is only listed if it has both a doc and docv specified.
deprecated, if specified the argument is deprecated and the string is a message output on standard error when the argument is used.
absent, if specified a documentation string that indicates what happens when the argument is absent. The document language can be used like in doc. This overrides the automatic default value rendering that is performed by the combinators.
val (&) : ('a->'b)->'a->'b
f & v is f v, a right associative composition operator for specifying argument terms.
Optional arguments
The information of an optional argument must have at least one name or Invalid_argument is raised.
flag i is a bool argument defined by an optional flag that may appear at most once on the command line under one of the names specified by i. The argument holds true if the flag is present on the command line and false otherwise.
flag_all is like flag except the flag may appear more than once. The argument holds a list that contains one true value per occurrence of the flag. It holds the empty list if the flag is absent from the command line.
vflag v [v0,i0;…] is an 'a argument defined by an optional flag that may appear at most once on the command line under one of the names specified in the ik values. The argument holds v if the flag is absent from the command line and the value vk if the name under which it appears is in ik.
Note. Environment variable lookup is unsupported for for these arguments.
val vflag_all : 'a list->('a * info) list->'a listt
vflag_all v l is like vflag except the flag may appear more than once. The argument holds the list v if the flag is absent from the command line. Otherwise it holds a list that contains one corresponding value per occurrence of the flag, in the order found on the command line.
Note. Environment variable lookup is unsupported for for these arguments.
opt vopt c v i is an 'a argument defined by the value of an optional argument that may appear at most once on the command line under one of the names specified by i. The argument holds v if the option is absent from the command line. Otherwise it has the value of the option as converted by c.
If vopt is provided the value of the optional argument is itself optional, taking the value vopt if unspecified on the command line.
val opt_all : ?vopt:'a->'aconv->'a list->info->'a listt
opt_all vopt c v i is like opt except the optional argument may appear more than once. The argument holds a list that contains one value per occurrence of the flag in the order found on the command line. It holds the list v if the flag is absent from the command line.
Positional arguments
The information of a positional argument must have no name or Invalid_argument is raised. Positional arguments indexing is zero-based.
Warning. The following combinators allow to specify and extract a given positional argument with more than one term. This should not be done as it will likely confuse end users and documentation generation. These over-specifications may be prevented by raising Invalid_argument in the future. But for now it is the client's duty to make sure this doesn't happen.
pos rev n c v i is an 'a argument defined by the nth positional argument of the command line as converted by c. If the positional argument is absent from the command line the argument is v.
If rev is true (defaults to false), the computed position is max-n where max is the position of the last positional argument present on the command line.
pos_all c v i is an 'a list argument that holds all the positional arguments of the command line as converted by c or v if there are none.
val pos_left : ?rev:bool ->int ->'aconv->'a list->info->'a listt
pos_left rev n c v i is an 'a list argument that holds all the positional arguments as converted by c found on the left of the nth positional argument or v if there are none.
If rev is true (defaults to false), the computed position is max-n where max is the position of the last positional argument present on the command line.
val pos_right : ?rev:bool ->int ->'aconv->'a list->info->'a listt
pos_right is like pos_left except it holds all the positional arguments found on the right of the specified positional argument.
required a is a term that fails if a's value is None and evaluates to the value of Some otherwise. Use this for required positional arguments (it can also be used for defining required optional arguments, but from a user interface perspective this shouldn't be done, it is a contradiction in terms).
last a is a term that fails if a's list is empty and evaluates to the value of the last element of the list otherwise. Use this for lists of flags or options where the last occurrence takes precedence over the others.
non_dir_file converts a value with the identity function and checks with Sys.file_exists and Sys.is_directory that a non directory file with that name exists.
t4 sep c0 c1 c2 c3 splits the argument at the first three sep characters (defaults to ',') respectively converts the substrings with c0, c1, c2 and c3.
Documentation formatting helpers
val doc_quote : string -> string
doc_quote s quotes the string s.
val doc_alts : ?quoted:bool ->string list-> string
doc_alts alts documents the alternative tokens alts according the number of alternatives. If quoted is:
None, the tokens are enclosed in manpage markup directives to render them in bold (manpage convention).
val info : ?deprecated:string ->?docs:string ->?doc:string ->var->info
info ~docs ~doc var describes an environment variable var such that:
doc is the man page information of the environment variable, defaults to "undocumented".
docs is the title of the man page section in which the environment variable will be listed, it defaults to Cmdliner.Manpage.s_environment.
deprecated, if specified the environment is deprecated and the string is a message output on standard error when the environment variable gets used to lookup the default value of an argument.
internal_error is 125, an exit status for unexpected internal errors.
Exit code information
type info
The type for exit code information.
val info : ?docs:string ->?doc:string ->?max:code->code->info
exit_info ~docs ~doc min ~max describe the range of exit statuses from min to max (defaults to min). doc is the man page information for the statuses, defaults to "undocumented". docs is the title of the man page section in which the statuses will be listed, it defaults to Manpage.s_exit_status.
Command line syntaxes are implicitely defined by Terms. A command value binds a syntax and its documentation to a command name.
A command can group a list of sub commands (and recursively). In this case your tool defines a tree of commands, each with its own command line syntax. The root of that tree is called the main command; it represents your tool and its name.
Command information
Command information defines the name and documentation of a command.
info ?sdocs ?man ?docs ?doc ?version name is a term information such that:
name is the name of the command.
version is the version string of the command line tool, this is only relevant for the main command and ignored otherwise.
deprecated, if specified the command is deprecated and the string is a message output on standard error when the command is used.
doc is a one line description of the command used for the NAME section of the command's man page and in command group listings.
docs, for commands that are part of a group, the title of the section of the parent's command man page where it should be listed (defaults to Manpage.s_commands).
sdocs defines the title of the section in which the standard --help and --version arguments are listed (defaults to Manpage.s_common_options).
exits is a list of exit statuses that the command evaluation may produce, defaults to Exit.defaults.
envs is a list of environment variables that influence the command's evaluation.
man is the text of the man page for the command.
man_xrefs are cross-references to other manual pages. These are used to generate a Manpage.s_see_also section.
v i t is a command with information i and command line syntax parsed by t.
val group : ?default:'aTerm.t->info->'at list->'at
group i ?default cmds is a command with information i that groups sub commands cmds. default is the command line syntax to parse if no sub command is specified on the command line. If default is None (default), the tool errors when no sub command is specified.
eval_peek_opts version_opt argv t evaluates t, a term made of optional arguments only, with the command line argv (defaults to Sys.argv). In this evaluation, unknown optional arguments and positional arguments are ignored.
The evaluation returns a pair. The first component is the result of parsing the command line argv stripped from any help and version option if version_opt is true (defaults to false). It results in:
Some _ if the command line would be parsed correctly given the partial knowledge in t.
None if a parse error would occur on the options of t
The second component is the result of parsing the command line argv without stripping the help and version options. It indicates what the evaluation would result in on argv given the partial knowledge in t (for example it would return `Help if there's a help option in argv). However in contrasts to eval_value no side effects like error reporting or help output occurs.
Note. Positional arguments can't be peeked without the full specification of the command line: we can't tell apart a positional argument from the value of an unknown optional argument.
`Pre t is a new preformatted paragraph with text t.
`I (l,t) is an indented paragraph with label l and text t.
`Noblank suppresses the blank line introduced between two blocks.
`Blocks bs splices the blocks bs.
Except in `Pre, whitespace and newlines are not significant and are all collapsed to a single space. All block strings support the documentation markup language.
The type for a man page. A title and the page text as a list of blocks.
type xref = [
| `Main
| `Cmd of string
| `Tool of string
| `Page of string * int
]
The type for man page cross-references.
`Main refers to the man page of the program itself.
`Cmd cmd refers to the man page of the program's cmd command (which must exist).
`Tool bin refers to the command line tool named bin.
`Page (name, sec) refers to the man page name(sec).
Standard section names and content
The following are standard man page section names, roughly ordered in the order they conventionally appear. See also man man-pages for more elaborations about what sections should contain.
val s_name : string
The NAME section. This section is automatically created by Cmdliner for your.
val s_synopsis : string
The SYNOPSIS section. By default this section is automatically created by Cmdliner for you, unless it is the first section of your term's man page, in which case it will replace it with yours.
val s_description : string
The DESCRIPTION section. This should be a description of what the tool does and provide a little bit of usage and documentation guidance.
val s_commands : string
The COMMANDS section. By default subcommands get listed here.
val s_arguments : string
The ARGUMENTS section. By default positional arguments get listed here.
val s_options : string
The OPTIONS section. By default optional arguments get listed here.
val s_common_options : string
The COMMON OPTIONS section. By default help and version options get listed here. For programs with multiple commands, optional arguments common to all commands can be added here.
val s_exit_status : string
The EXIT STATUS section. By default term status exit codes get listed here.
val s_environment : string
The ENVIRONMENT section. By default environment variables get listed here.
print ~errs ~subst fmt ppf page prints page on ppf in the format fmt. subst can be used to perform variable substitution,(defaults to the identity). errs is used to print formatting errors, it defaults to Format.err_formatter.
A term is evaluated by a program to produce a result, which can be turned into an exit status. A term made of terms referring to command line arguments implicitly defines a command line syntax.
Terms
type+'a t
The type for terms evaluating to values of type 'a.
ret v is a term whose evaluation depends on the case to which v evaluates. With :
`Ok v, it evaluates to v.
`Error (usage, e), the evaluation fails and Cmdliner prints the error e and the term's usage if usage is true.
`Help (format, name), the evaluation fails and Cmdliner prints a manpage in format format. If name is None this is the the main command's manpage. If name is Some c this is the man page of the sub command c of the main command.
Note. While not deprecated you are encouraged not use this API.
Deprecated Term evaluation interface
This interface is deprecated in favor of Cmdliner.Cmd. Follow the compiler deprecation warning hints to transition.
Term information
Term information defines the name and man page of a term. For simple evaluation this is the name of the program and its man page. For multiple term evaluation, this is the name of a command and its man page.
type exit_info
The type for exit status information.
deprecated Use Cmd.Exit.info instead.
val exit_info : ?docs:string ->?doc:string ->?max:int ->int ->exit_info
exit_info ~docs ~doc min ~max describe the range of exit statuses from min to max (defaults to min). doc is the man page information for the statuses, defaults to "undocumented". docs is the title of the man page section in which the statuses will be listed, it defaults to Manpage.s_exit_status.
deprecated List.filter the Cmd.Exit.defaults value instead.
type env_info
The type for environment variable information.
deprecated Use Cmd.Env.info instead.
val env_info : ?docs:string ->?doc:string ->string ->env_info
env_info ~docs ~doc var describes an environment variable var. doc is the man page information of the environment variable, defaults to "undocumented". docs is the title of the man page section in which the environment variable will be listed, it defaults to Cmdliner.Manpage.s_environment.
info sdocs man docs doc version name is a term information such that:
name is the name of the program or the command.
version is the version string of the program, ignored for commands.
doc is a one line description of the program or command used for the NAME section of the term's man page. For commands this description is also used in the list of commands of the main term's man page.
docs, only for commands, the title of the section of the main term's man page where it should be listed (defaults to Manpage.s_commands).
sdocs defines the title of the section in which the standard --help and --version arguments are listed (defaults to Manpage.s_options).
exits is a list of exit statuses that the term evaluation may produce.
envs is a list of environment variables that influence the term's evaluation.
man is the text of the man page for the term.
man_xrefs are cross-references to other manual pages. These are used to generate a Manpage.s_see_also section.
eval help err catch argv (t,i) is the evaluation result of t with command line arguments argv (defaults to Sys.argv).
If catch is true (default) uncaught exceptions are intercepted and their stack trace is written to the err formatter.
help is the formatter used to print help or version messages (defaults to Format.std_formatter). err is the formatter used to print error messages (defaults to Format.err_formatter).
env is used for environment variable lookup, the default uses Sys.getenv.
deprecated Use Cmd.v and one of Cmd.eval* instead.
eval_choice help err catch argv (t,i) choices is like eval except that if the first argument on the command line is not an option name it will look in choices for a term whose information has this name and evaluate it.
If the command name is unknown an error is reported. If the name is unspecified the "main" term t is evaluated. i defines the name and man page of the program.
deprecated Use Cmd.group and one of Cmd.eval* instead.
val eval_peek_opts :
+ ?version_opt:bool ->
+ ?env:(string ->string option)->
+ ?argv:string array->
+ 'at->
+ 'a option * 'aresult
eval_peek_opts version_opt argv t evaluates t, a term made of optional arguments only, with the command line argv (defaults to Sys.argv). In this evaluation, unknown optional arguments and positional arguments are ignored.
The evaluation returns a pair. The first component is the result of parsing the command line argv stripped from any help and version option if version_opt is true (defaults to false). It results in:
Some _ if the command line would be parsed correctly given the partial knowledge in t.
None if a parse error would occur on the options of t
The second component is the result of parsing the command line argv without stripping the help and version options. It indicates what the evaluation would result in on argv given the partial knowledge in t (for example it would return `Help if there's a help option in argv). However in contrasts to eval and eval_choice no side effects like error reporting or help output occurs.
Note. Positional arguments can't be peeked without the full specification of the command line: we can't tell apart a positional argument from the value of an unknown optional argument.
deprecated Use Cmd.eval_peek_opts instead.
Turning evaluation results into exit codes
Note. If you are using the following functions to handle the evaluation result of a term you should add default_exits to the term's information ~exits argument.
WARNING. You should avoid status codes strictly greater than 125 as those may be used by some shells.
val exit_status_success : int
exit_status_success is 0, the exit status for success.
deprecated Use Cmd.Exit.ok instead.
val exit_status_cli_error : int
exit_status_cli_error is 124, an exit status for command line parsing errors.
deprecated Use Cmd.Exit.cli_error instead.
val exit_status_internal_error : int
exit_status_internal_error is 125, an exit status for unexpected internal errors.
deprecated Use Cmd.Exit.internal_error instead.
val exit_status_of_result : ?term_err:int ->unit result-> int
exit_status_of_result ~term_err r is an exit(3) status code determined from r as follows:
diff --git a/cmdliner/_doc-dir/CHANGES.md b/cmdliner/_doc-dir/CHANGES.md
new file mode 100755
index 00000000..67d7f8e7
--- /dev/null
+++ b/cmdliner/_doc-dir/CHANGES.md
@@ -0,0 +1,421 @@
+v1.2.0 2023-04-10 La Forclaz (VS)
+---------------------------------
+
+- In manpage specification the new variable `$(iname)` substitutes the
+ command invocation (from program name to subcommand) in bold (#168).
+ This variable is now used in the default introduction of the `EXIT STATUS`
+ section. Thanks to Ali Caglayan for suggesting.
+- Fix manpage rendering when `PAGER=less` is set (#167).
+- Plain text manpage rendering: fix broken handling of `` `Noblank ``.
+ Thanks to Michael Richards and Reynir Björnsson for the report (#176).
+- Fix install to directory with spaces (#172). Thanks to
+ @ZSFactory for reporting and suggesting the fix.
+- Fix manpage paging on Windows (#166). Thanks to Nicolás Ojeda Bär
+ for the report and the solution.
+
+v1.1.1 2022-03-23 La Forclaz (VS)
+---------------------------------
+
+- General documentation fixes, tweaks and improvements.
+- Docgen: suppress trailing whitespace in synopsis rendering.
+- Docgen: fix duplicate rendering of standard options when using `Term.ret` (#135).
+- Docgen: fix duplicate rendering of command name on ``Term.ret (`Help (fmt, None)``
+ (#135).
+
+v1.1.0 2022-02-06 La Forclaz (VS)
+---------------------------------
+
+- Require OCaml 4.08.
+
+- Support for deprecating commands, arguments and environment variables (#66).
+ See the `?deprecated` argument of `Cmd.info`, `Cmd.Env.info` and `Arg.info`.
+
+- Add `Manpage.s_none` a special section name to use whenever you
+ want something not to be listed in a command's manpage.
+
+- Add `Arg.conv'` like `Arg.conv` but with a parser signature that returns
+ untagged string errors.
+
+- Add `Term.{term,cli_parse}_result'` functions.
+
+- Add deprecation alerts on what is already deprecated.
+
+- On unices, use `command -v` rather than `type` to find commands.
+
+- Stop using backticks for left quotes. Use apostrophes everywhere.
+ Thanks to Ryan Moore for reporting a typo that prompted the change (#128).
+
+- Rework documentation structure. Move out tutorial, examples and
+ reference doc from the `.mli` to multiple `.mld` pages.
+
+- `Arg.doc_alts` and `Arg.doc_alts_enum`, change the default rendering
+ to match the manpage convention which is to render these tokens in
+ bold. If you want to recover the previous rendering or were using
+ these functions outside man page rendering use an explicit
+ `~quoted:true` (the optional argument is available on earlier
+ versions).
+
+- The deprecated `Term.exit` and `Term.exit_status_of_result` now
+ require a `unit` result. This avoids various errors to go undetected.
+ Thanks to Thomas Leonard for the patch (#124).
+
+- Fix absent and default option values (`?none` string argument of `Arg.some`)
+ rendering in manpages:
+
+ 1. They were not escaped, they now are.
+ 2. They where not rendered in bold, they now are.
+ 3. The documentation language was interpreted, it is no longer the case.
+
+ If you were relying on the third point via `?none` of `Arg.some`, use the new
+ `?absent` optional argument of `Arg.info` instead. Besides a new
+ `Arg.some'` function is added to specify a value for `?none` instead
+ of a string. Thanks to David Allsopp for the patch (#111).
+
+- Documentation generation use: `…` (U+2026) instead of `...` for
+ ellipsis. See also UTF-8 manpage support below.
+
+- Documentation generation, improve command synopsis rendering on
+ commands with few options (i.e. mention them).
+
+- Documentation generation, drop section heading in the output if the section
+ is empty.
+
+### New `Cmd` module and deprecation of the `Term` evaluation interface
+
+This version of cmdliner deprecates the `Term.eval*` evaluation
+functions and `Term.info` information values in favor of the new
+`Cmdliner.Cmd` module.
+
+The `Cmd` module generalizes the existing sub command support to allow
+arbitrarily nested sub commands each with its own man page and command
+line syntax represented by a `Term.t` value.
+
+The mapping between the old interface and the new one should be rather
+straightforward. In particular `Term.info` and `Cmd.info` have exactly
+the same semantics and fields and a command value simply pairs a
+command information with a term.
+
+However in this transition the following things are changed or added:
+
+* All default values of `Cmd.info` match those of `Term.info` except
+ for:
+ * The `?exits` argument which defaults to `Cmd.Exit.defaults`
+ rather than the empty list.
+ * The `?man_xrefs` which defaults to the list ``[`Main]`` rather
+ than the empty list (this means that by default sub commands
+ at any level automatically cross-reference the main command).
+ * The `?sdocs` argument which defaults to `Manpage.s_common_options`
+ rather than `Manpage.s_options`.
+
+* The `Cmd.Exit.some_error` code is added to `Cmd.Exit.defaults`
+ (which in turn is the default for `Cmd.info` see above). This is an
+ error code clients can use when they don't want to bother about
+ having precise exit codes. It is high so that low, meaningful,
+ codes can later be added without breaking a tool's compatibility. In
+ particular the convenience evaluation functions `Cmd.eval_result*`
+ use this code when they evaluate to an error.
+
+* If you relied on `?term_err` defaulting to `1` in the various
+ `Term.exit*` function, note that the new `Cmd.eval*` function use
+ `Exit.cli_error` as a default. You may want to explicitly specify
+ `1` instead if you use `Term.ret` with the `` `Error`` case
+ or `Term.term_result`.
+
+Finally be aware that if you replace, in an existing tool, an encoding
+of sub commands as positional arguments you will effectively break the
+command line compatibility of your tool since options can no longer be
+specified before the sub commands, i.e. your tool synopsis moves from:
+
+```
+tool cmd [OPTION]… SUBCMD [ARG]…
+```
+to
+```
+tool cmd SUBCMD [OPTION]… [ARG]…
+```
+
+Thanks to Rudi Grinberg for prototyping the feature in #123.
+
+### UTF-8 manpage support
+
+It is now possible to write UTF-8 encoded text in your doc strings and
+man pages.
+
+The man page renderer used on `--help` defaults to `mandoc` if
+available, then uses `groff` and then defaults to `nroff`. Starting
+with `mandoc` catches macOS whose `groff` as of 11.6 still doesn't
+support UTF-8 input and struggles to render some Unicode characters.
+
+The invocations were also tweaked to remove the `-P-c` option which
+entails that the default pager `less` is now invoked with the `-R` option.
+
+If you install UTF-8 encoded man pages output via `--help=groff`, in
+`man` directories bear in mind that these pages will look garbled on
+stock macOS (at least until 11.6). One way to work around is to
+instruct your users to change the `NROFF` definition in
+`/private/etc/man.conf` from:
+
+ NROFF /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c
+
+to:
+
+ NROFF /usr/bin/mandoc -Tutf8 -c
+
+Thanks to Antonin Décimo for his knowledge and helping with these
+`man`gnificent intricacies (#27).
+
+v1.0.4 2019-06-14 Zagreb
+------------------------
+
+- Change the way `Error (_, e)` term evaluation results
+ are formatted. Instead of treating `e` as text, treat
+ it as formatted lines.
+- Fix 4.08 `Pervasives` deprecation.
+- Fix 4.03 String deprecations.
+- Fix bootstrap build in absence of dynlink.
+- Make the `Makefile` bootstrap build reproducible.
+ Thanks to Thomas Leonard for the patch.
+
+v1.0.3 2018-11-26 Zagreb
+------------------------
+
+- Add `Term.with_used_args`. Thanks to Jeremie Dimino for
+ the patch.
+- Use `Makefile` bootstrap build in opam file.
+- Drop ocamlbuild requirement for `Makefile` bootstrap build.
+- Drop support for ocaml < 4.03.0
+- Dune build support.
+
+v1.0.2 2017-08-07 Zagreb
+------------------------
+
+- Don't remove the `Makefile` from the distribution.
+
+v1.0.1 2017-08-03 Zagreb
+------------------------
+
+- Add a `Makefile` to build and install cmdliner without `topkg` and
+ opam `.install` files. Helps bootstraping opam in OS package
+ managers. Thanks to Hendrik Tews for the patches.
+
+v1.0.0 2017-03-02 La Forclaz (VS)
+---------------------------------
+
+**IMPORTANT** The `Arg.converter` type is deprecated in favor of the
+`Arg.conv` type. For this release both types are equal but the next
+major release will drop the former and make the latter abstract. All
+users are kindly requested to migrate to use the new type and **only**
+via the new `Arg.[p]conv` and `Arg.conv_{parser,printer}` functions.
+
+- Allow terms to be used more than once in terms without tripping out
+ documentation generation (#77). Thanks to François Bobot and Gabriel
+ Radanne.
+- Disallow defining the same option (resp. command) name twice via two
+ different arguments (resp. terms). Raises Invalid_argument, used
+ to be undefined behaviour (in practice, an arbitrary one would be
+ ignored).
+- Improve converter API (see important message above).
+- Add `Term.exit[_status]` and `Term.exit_status_of[_status]_result`.
+ improves composition with `Pervasives.exit`.
+- Add `Term.term_result` and `Term.cli_parse_result` improves composition
+ with terms evaluating to `result` types.
+- Add `Arg.parser_of_kind_of_string`.
+- Change semantics of `Arg.pos_left` (see #76 for details).
+- Deprecate `Term.man_format` in favor of `Arg.man_format`.
+- Reserve the `--cmdliner` option for library use. This is unused for now
+ but will be in the future.
+- Relicense from BSD3 to ISC.
+- Safe-string support.
+- Build depend on topkg.
+
+### End-user visible changes
+
+The following changes affect the end-user behaviour of all binaries using
+cmdliner.
+
+- Required positional arguments. All missing required position
+ arguments are now reported to the end-user, in the correct
+ order (#39). Thanks to Dmitrii Kashin for the report.
+- Optional arguments. All unknown and ambiguous optional argument
+ arguments are now reported to the end-user (instead of only
+ the first one).
+- Change default behaviour of `--help[=FMT]` option. `FMT` no longer
+ defaults to `pager` if unspecified. It defaults to the new value
+ `auto` which prints the help as `pager` or `plain` whenever the
+ `TERM` environment variable is `dumb` or undefined (#43). At the API
+ level this changes the signature of the type `Term.ret` and values
+ `Term.ret`, `Term.man_format` (deprecated) and `Manpage.print` to add the
+ new `` `Auto`` case to manual formats. These are now represented by the
+ `Manpage.format` type rather than inlined polyvars.
+
+### Doc specification improvements and fixes
+
+- Add `?envs` optional argument to `Term.info`. Documents environment
+ variables that influence a term's evaluation and automatically
+ integrate them in the manual.
+- Add `?exits` optional argument to `Term.info`. Documents exit statuses of
+ the program. Use `Term.default_exits` if you are using the new `Term.exit`
+ functions.
+- Add `?man_xrefs` optional argument to `Term.info`. Documents
+ references to other manpages. Automatically formats a `SEE ALSO` section
+ in the manual.
+- Add `Manpage.escape` to escape a string from the documentation markup
+ language.
+- Add `Manpage.s_*` constants for standard man page section names.
+- Add a `` `Blocks`` case to `Manpage.blocks` to allow block splicing
+ (#69). This avoids having to concatenate block lists at the
+ toplevel of your program.
+- `Arg.env_var`, change default environment variable section to the
+ standard `ENVIRONMENT` manual section rather than `ENVIRONMENT
+ VARIABLES`. If you previously manually positioned that section in
+ your man page you will have to change the name. See also next point.
+- Fix automatic placement of default environment variable section (#44)
+ whenever unspecified in the man page.
+- Better automatic insertions of man page sections (#73). See the API
+ docs about manual specification. As a side effect the `NAME` section
+ can now also be overridden manually.
+- Fix repeated environment variable printing for flags (#64). Thanks to
+ Thomas Gazagnaire for the report.
+- Fix rendering of env vars in man pages, bold is standard (#71).
+- Fix plain help formatting for commands with empty
+ description. Thanks to Maciek Starzyk for the patch.
+- Fix (implement really) groff man page escaping (#48).
+- Request `an` macros directly in the man page via `.mso` this
+ makes man pages self-describing and avoids having to call `groff` with
+ the `-man` option.
+- Document required optional arguments as such (#82). Thanks to Isaac Hodes
+ for the report.
+
+### Doc language sanitization
+
+This release tries to bring sanity to the doc language. This may break
+the rendering of some of your man pages. Thanks to Gabriel Scherer,
+Ivan Gotovchits and Nicolás Ojeda Bär for the feedback.
+
+- It is only allowed to use the variables `$(var)` that are mentioned in
+ the docs (`$(docv)`, `$(opt)`, etc.) and the markup directives
+ `$({i,b},text)`. Any other unknown `$(var)` will generate errors
+ on standard error during documentation generation.
+- Markup directives `$({i,b},text)` treat `text` as is, modulo escapes;
+ see next point.
+- Characters `$`, `(`, `)` and `\` can respectively be escaped by `\$`,
+ `\(`, `\)` and `\\`. Escaping `$` and `\` is mandatory everywhere.
+ Escaping `)` is mandatory only in markup directives. Escaping `(`
+ is only here for your symmetric pleasure. Any other sequence of
+ character starting with a `\` is an illegal sequence.
+- Variables `$(mname)` and `$(tname)` are now marked up with bold when
+ substituted. If you used to write `$(b,$(tname))` this will generate
+ an error on standard output, since `$` is not escaped in the markup
+ directive. Simply replace these by `$(tname)`.
+
+v0.9.8 2015-10-11 Cambridge (UK)
+--------------------------------
+
+- Bring back support for OCaml 3.12.0
+- Support for pre-formatted paragraphs in man pages. This adds a
+ ```Pre`` case to the `Manpage.block` type which can break existing
+ programs. Thanks to Guillaume Bury for suggesting and help.
+- Support for environment variables. If an argument is absent from the
+ command line, its value can be read and parsed from an environment
+ variable. This adds an `env` optional argument to the `Arg.info`
+ function which can break existing programs.
+- Support for new variables in option documentation strings. `$(opt)`
+ can be used to refer to the name of the option being documented and
+ `$(env)` for the name of the option's the environment variable.
+- Deprecate `Term.pure` in favor of `Term.const`.
+- Man page generation. Keep undefined variables untouched. Previously
+ a `$(undef)` would be turned into `undef`.
+- Turn a few mysterious and spurious `Not_found` exceptions into
+ `Invalid_arg`. These can be triggered by client programming errors
+ (e.g. an unclosed variable in a documentation string).
+- Positional arguments. Invoke the printer on the default (absent)
+ value only if needed. See Optional arguments in the release notes of
+ v0.9.6.
+
+v0.9.7 2015-02-06 La Forclaz (VS)
+---------------------------------
+
+- Build system, don't depend on `ocamlfind`. The package no longer
+ depends on ocamlfind. Thanks to Louis Gesbert for the patch.
+
+v0.9.6 2014-11-18 La Forclaz (VS)
+---------------------------------
+
+- Optional arguments. Invoke the printer on the default (absent) value
+ only if needed, i.e. if help is shown. Strictly speaking an
+ interface breaking change – for example if the absent value was lazy
+ it would be forced on each run. This is no longer the case.
+- Parsed command line syntax: allow short flags to be specified
+ together under a single dash, possibly ending with a short option.
+ This allows to specify e.g. `tar -xvzf archive.tgz` or `tar
+ -xvzfarchive.tgz`. Previously this resulted in an error, all the
+ short flags had to be specified separately. Backward compatible in
+ the sense that only more command lines are parsed. Thanks to Hugo
+ Heuzard for the patch.
+- End user error message improvements using heuristics and edit
+ distance search in the optional argument and sub command name
+ spaces. Thanks to Hugo Heuzard for the patch.
+- Adds `Arg.doc_{quote,alts,alts_enum}`, documentation string
+ helpers.
+- Adds the `Term.eval_peek_opts` function for advanced usage scenarios.
+- The function `Arg.enum` now raises `Invalid_argument` if the
+ enumeration is empty.
+- Improves help paging behaviour on Windows. Thanks to Romain Bardou
+ for the help.
+
+
+v0.9.5 2014-07-04 Cambridge (UK)
+--------------------------------
+
+- Add variance annotation to Term.t. Thanks to Peter Zotov for suggesting.
+- Fix section name formatting in plain text output. Thanks to Mikhail
+ Sobolev for reporting.
+
+
+v0.9.4 2014-02-09 La Forclaz (VS)
+---------------------------------
+
+- Remove temporary files created for paged help. Thanks to Kaustuv Chaudhuri
+ for the suggestion.
+- Avoid linking against `Oo` (was used to get program uuid).
+- Check the environment for `$MANPAGER` as well. Thanks to Raphaël Proust
+ for the patch.
+- OPAM friendly workflow and drop OASIS support.
+
+
+v0.9.3 2013-01-04 La Forclaz (VS)
+---------------------------------
+
+- Allow user specified `SYNOPSIS` sections.
+
+
+v0.9.2 2012-08-05 Lausanne
+--------------------------
+
+- OASIS 0.3.0 support.
+
+
+v0.9.1 2012-03-17 La Forclaz (VS)
+---------------------------------
+
+- OASIS support.
+- Fixed broken `Arg.pos_right`.
+- Variables `$(tname)` and `$(mname)` can be used in a term's man
+ page to respectively refer to the term's name and the main term
+ name.
+- Support for custom variable substitution in `Manpage.print`.
+- Adds `Term.man_format`, to facilitate the definition of help commands.
+- Rewrote the examples with a better and consistent style.
+
+Incompatible API changes:
+
+- The signature of `Term.eval` and `Term.eval_choice` changed to make
+ it more regular: the given term and its info must be tupled together
+ even for the main term and the tuple order was swapped to make it
+ consistent with the one used for arguments.
+
+
+v0.9.0 2011-05-27 Lausanne
+--------------------------
+
+- First release.
diff --git a/cmdliner/_doc-dir/LICENSE.md b/cmdliner/_doc-dir/LICENSE.md
new file mode 100755
index 00000000..c4cd256d
--- /dev/null
+++ b/cmdliner/_doc-dir/LICENSE.md
@@ -0,0 +1,13 @@
+Copyright (c) 2011 The cmdliner programmers
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/cmdliner/_doc-dir/README.md b/cmdliner/_doc-dir/README.md
new file mode 100755
index 00000000..6e5ff4c1
--- /dev/null
+++ b/cmdliner/_doc-dir/README.md
@@ -0,0 +1,49 @@
+Cmdliner — Declarative definition of command line interfaces for OCaml
+-------------------------------------------------------------------------------
+v1.2.0
+
+Cmdliner allows the declarative definition of command line interfaces
+for OCaml.
+
+It provides a simple and compositional mechanism to convert command
+line arguments to OCaml values and pass them to your functions. The
+module automatically handles syntax errors, help messages and UNIX man
+page generation. It supports programs with single or multiple commands
+and respects most of the [POSIX][1] and [GNU][2] conventions.
+
+Cmdliner has no dependencies and is distributed under the ISC license.
+
+[1]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
+[2]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
+
+Home page: http://erratique.ch/software/cmdliner
+
+## Installation
+
+Cmdliner can be installed with `opam`:
+
+ opam install cmdliner
+
+If you don't use `opam` consult the [`opam`](opam) file for build
+instructions.
+
+
+## Documentation
+
+The documentation and API reference is automatically generated by from
+the source interfaces. It can be consulted [online][doc] or via
+`odig doc cmdliner`.
+
+[doc]: http://erratique.ch/software/cmdliner/doc/Cmdliner
+
+
+## Sample programs
+
+If you installed Cmdliner with `opam` sample programs are located in
+the directory `opam config var cmdliner:doc`. These programs define
+the command line of some classic programs.
+
+In the distribution sample programs are located in the `test`
+directory of the distribution. They can be built and run with:
+
+ topkg build --tests true && topkg test
diff --git a/cmdliner/_doc-dir/odoc-pages/cli.mld b/cmdliner/_doc-dir/odoc-pages/cli.mld
new file mode 100755
index 00000000..35799333
--- /dev/null
+++ b/cmdliner/_doc-dir/odoc-pages/cli.mld
@@ -0,0 +1,121 @@
+{0:cmdline Command line interface}
+
+For tools evaluating a command without sub commands the most general
+form of invocation is:
+
+{[
+tool [OPTION]… [ARG]…
+]}
+
+The tool automatically reponds to the [--help] option by printing the
+help. If a version string is provided in the
+{{!Cmdliner.Cmd.val-info}command information}, it also automatically
+responds to the [--version] option by printing this string on standard
+output.
+
+Command line arguments are either {{!optargs}{e optional}} or
+{{!posargs}{e positional}}. Both can be freely interleaved but since
+[Cmdliner] accepts many optional forms this may result in
+ambiguities. The special {{!posargs} token [--]} can be used to
+resolve them; anything that follows it is treated as a positional
+argument.
+
+Tools evaluating commands with sub commands have this form of invocation
+
+{[
+tool [COMMAND]… [OPTION]… [ARG]…
+]}
+
+Commands automatically respond to the [--help] option by printing
+their help. The sequence of [COMMAND] strings must be the first
+strings following the tool name – as soon as an optional argument is
+seen the search for a sub command stops. Command names may be specified by
+a prefixe as long as they are not ambiguous.
+
+{1:optargs Optional arguments}
+
+An optional argument is specified on the command line by a {e name}
+possibly followed by a {e value}.
+
+The name of an option can be short or long.
+
+{ul
+{- A {e short} name is a dash followed by a single alphanumeric
+ character: [-h], [-q], [-I].}
+{- A {e long} name is two dashes followed by alphanumeric
+ characters and dashes: [--help], [--silent], [--ignore-case].}}
+
+More than one name may refer to the same optional argument. For
+example in a given program the names [-q], [--quiet] and [--silent]
+may all stand for the same boolean argument indicating the program to
+be quiet. Long names can be specified by any non ambiguous prefix.
+
+The value of an option can be specified in three different ways.
+
+{ul
+{- As the next token on the command line: [-o a.out], [--output a.out].}
+{- Glued to a short name: [-oa.out].}
+{- Glued to a long name after an equal character: [--output=a.out].}}
+
+Glued forms are especially useful if the value itself starts with a
+dash as is the case for negative numbers, [--min=-10].
+
+An optional argument without a value is either a {e flag} (see
+{!Cmdliner.Arg.flag}, {!Cmdliner.Arg.vflag}) or an optional argument with
+an optional value (see the [~vopt] argument of {!Cmdliner.Arg.opt}).
+
+Short flags can be grouped together to share a single dash and the
+group can end with a short option. For example assuming [-v] and
+[-x] are flags and [-f] is a short option:
+
+{ul
+{- [-vx] will be parsed as [-v -x].}
+{- [-vxfopt] will be parsed as [-v -x -fopt].}
+{- [-vxf opt] will be parsed as [-v -x -fopt].}
+{- [-fvx] will be parsed as [-f=vx].}}
+
+{1:posargs Positional arguments}
+
+Positional arguments are tokens on the command line that are not
+option names and are not the value of an optional argument. They are
+numbered from left to right starting with zero.
+
+Since positional arguments may be mistaken as the optional value of an
+optional argument or they may need to look like option names, anything
+that follows the special token ["--"] on the command line is
+considered to be a positional argument:
+
+{[
+tool --option -- we -are --all positional --argu=ments
+]}
+
+{1:envlookup Environment variables}
+
+Non-required command line arguments can be backed up by an environment
+variable. If the argument is absent from the command line and that
+the environment variable is defined, its value is parsed using the
+argument converter and defines the value of the argument.
+
+For {!Cmdliner.Arg.flag} and {!Cmdliner.Arg.flag_all} that do not have an
+argument converter a boolean is parsed from the lowercased variable value
+as follows:
+
+{ul
+{- [""], ["false"], ["no"], ["n"] or ["0"] is [false].}
+{- ["true"], ["yes"], ["y"] or ["1"] is [true].}
+{- Any other string is an error.}}
+
+Note that environment variables are not supported for {!Cmdliner.Arg.vflag} and
+{!Cmdliner.Arg.vflag_all}.
+
+{1:reserved Reserved option names}
+
+Using the cmdliner library puts the following constraints o
+
+{ul
+{- The option name [--cmdliner] is reserved by the library.}
+{- The option name [--help], (and [--version] if you specify a version
+ string) is reserved by the library. Using it as a term or option
+ name may result in undefined behaviour.}
+{- Defining the same option or command name via two different
+ arguments or terms is illegal and raises [Invalid_argument].}}
diff --git a/cmdliner/_doc-dir/odoc-pages/examples.mld b/cmdliner/_doc-dir/odoc-pages/examples.mld
new file mode 100755
index 00000000..8ac88212
--- /dev/null
+++ b/cmdliner/_doc-dir/odoc-pages/examples.mld
@@ -0,0 +1,443 @@
+{0 Examples}
+
+The examples are self-contained, cut and paste them in a file to play
+with them.
+
+{1:exrm A [rm] command}
+
+We define the command line interface of an [rm] command with the
+synopsis:
+
+{v
+rm [OPTION]… FILE…
+v}
+
+The [-f], [-i] and [-I] flags define the prompt behaviour of [rm]. It
+is represented in our program by the [prompt] type. If more than one
+of these flags is present on the command line the last one takes
+precedence.
+
+To implement this behaviour we map the presence of these flags to
+values of the [prompt] type by using {!Cmdliner.Arg.vflag_all}.
+
+This argument will contain all occurrences of the flag on the command
+line and we just take the {!Cmdliner.Arg.last} one to define our term
+value. If there is no occurrence the last value of the default list
+[[Always]] is taken. This means the default prompt behaviour is [Always].
+
+{[
+(* Implementation of the command, we just print the args. *)
+
+type prompt = Always | Once | Never
+let prompt_str = function
+| Always -> "always" | Once -> "once" | Never -> "never"
+
+let rm prompt recurse files =
+ Printf.printf "prompt = %s\nrecurse = %B\nfiles = %s\n"
+ (prompt_str prompt) recurse (String.concat ", " files)
+
+(* Command line interface *)
+
+open Cmdliner
+
+let files = Arg.(non_empty & pos_all file [] & info [] ~docv:"FILE")
+let prompt =
+ let always =
+ let doc = "Prompt before every removal." in
+ Always, Arg.info ["i"] ~doc
+ in
+ let never =
+ let doc = "Ignore nonexistent files and never prompt." in
+ Never, Arg.info ["f"; "force"] ~doc
+ in
+ let once =
+ let doc = "Prompt once before removing more than three files, or when
+ removing recursively. Less intrusive than $(b,-i), while
+ still giving protection against most mistakes."
+ in
+ Once, Arg.info ["I"] ~doc
+ in
+ Arg.(last & vflag_all [Always] [always; never; once])
+
+let recursive =
+ let doc = "Remove directories and their contents recursively." in
+ Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)
+
+let cmd =
+ let doc = "Remove files or directories" in
+ let man = [
+ `S Manpage.s_description;
+ `P "$(tname) removes each specified $(i,FILE). By default it does not
+ remove directories, to also remove them and their contents, use the
+ option $(b,--recursive) ($(b,-r) or $(b,-R)).";
+ `P "To remove a file whose name starts with a $(b,-), for example
+ $(b,-foo), use one of these commands:";
+ `Pre "$(mname) $(b,-- -foo)"; `Noblank;
+ `Pre "$(mname) $(b,./-foo)";
+ `P "$(tname) removes symbolic links, not the files referenced by the
+ links.";
+ `S Manpage.s_bugs; `P "Report bugs to .";
+ `S Manpage.s_see_also; `P "$(b,rmdir)(1), $(b,unlink)(2)" ]
+ in
+ let info = Cmd.info "rm" ~version:"v1.2.0" ~doc ~man in
+ Cmd.v info Term.(const rm $ prompt $ recursive $ files)
+
+let main () = exit (Cmd.eval cmd)
+let () = main ()
+]}
+
+{1:excp A [cp] command}
+
+We define the command line interface of a [cp] command with the synopsis:
+{v
+cp [OPTION]… SOURCE… DEST
+v}
+
+The [DEST] argument must be a directory if there is more than one
+[SOURCE]. This constraint is too complex to be expressed by the
+combinators of {!Cmdliner.Arg}.
+
+Hence we just give [DEST] the {!Cmdliner.Arg.string} type and verify the
+constraint at the beginning of the implementation of [cp]. If the
+constraint is unsatisfied we return an [`Error] result. By using
+{!Cmdliner.Term.val-ret} on the lifted result [cp_t] of [cp],
+[Cmdliner] handles the error reporting.
+
+{[
+(* Implementation, we check the dest argument and print the args *)
+
+let cp verbose recurse force srcs dest =
+ let many = List.length srcs > 1 in
+ if many && (not (Sys.file_exists dest) || not (Sys.is_directory dest))
+ then `Error (false, dest ^ ": not a directory") else
+ `Ok (Printf.printf
+ "verbose = %B\nrecurse = %B\nforce = %B\nsrcs = %s\ndest = %s\n"
+ verbose recurse force (String.concat ", " srcs) dest)
+
+(* Command line interface *)
+
+open Cmdliner
+
+let verbose =
+ let doc = "Print file names as they are copied." in
+ Arg.(value & flag & info ["v"; "verbose"] ~doc)
+
+let recurse =
+ let doc = "Copy directories recursively." in
+ Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)
+
+let force =
+ let doc = "If a destination file cannot be opened, remove it and try again."in
+ Arg.(value & flag & info ["f"; "force"] ~doc)
+
+let srcs =
+ let doc = "Source file(s) to copy." in
+ Arg.(non_empty & pos_left ~rev:true 0 file [] & info [] ~docv:"SOURCE" ~doc)
+
+let dest =
+ let doc = "Destination of the copy. Must be a directory if there is more \
+ than one $(i,SOURCE)." in
+ let docv = "DEST" in
+ Arg.(required & pos ~rev:true 0 (some string) None & info [] ~docv ~doc)
+
+let cmd =
+ let doc = "Copy files" in
+ let man_xrefs =
+ [ `Tool "mv"; `Tool "scp"; `Page ("umask", 2); `Page ("symlink", 7) ]
+ in
+ let man =
+ [ `S Manpage.s_bugs;
+ `P "Email them to ."; ]
+ in
+ let info = Cmd.info "cp" ~version:"v1.2.0" ~doc ~man ~man_xrefs in
+ Cmd.v info Term.(ret (const cp $ verbose $ recurse $ force $ srcs $ dest))
+
+
+let main () = exit (Cmd.eval cmd)
+let () = main ()
+]}
+
+{1:extail A [tail] command}
+
+We define the command line interface of a [tail] command with the
+synopsis:
+
+{v
+tail [OPTION]… [FILE]…
+v}
+
+The [--lines] option whose value specifies the number of last lines to
+print has a special syntax where a [+] prefix indicates to start
+printing from that line number. In the program this is represented by
+the [loc] type. We define a custom [loc_arg]
+{{!Cmdliner.Arg.type-conv}argument converter} for this option.
+
+The [--follow] option has an optional enumerated value. The argument
+converter [follow], created with {!Cmdliner.Arg.enum} parses the
+option value into the enumeration. By using {!Cmdliner.Arg.some} and
+the [~vopt] argument of {!Cmdliner.Arg.opt}, the term corresponding to
+the option [--follow] evaluates to [None] if [--follow] is absent from
+the command line, to [Some Descriptor] if present but without a value
+and to [Some v] if present with a value [v] specified.
+
+{[
+(* Implementation of the command, we just print the args. *)
+
+type loc = bool * int
+type verb = Verbose | Quiet
+type follow = Name | Descriptor
+
+let str = Printf.sprintf
+let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
+let loc_str (rev, k) = if rev then str "%d" k else str "+%d" k
+let follow_str = function Name -> "name" | Descriptor -> "descriptor"
+let verb_str = function Verbose -> "verbose" | Quiet -> "quiet"
+
+let tail lines follow verb pid files =
+ Printf.printf
+ "lines = %s\nfollow = %s\nverb = %s\npid = %s\nfiles = %s\n"
+ (loc_str lines) (opt_str follow_str follow) (verb_str verb)
+ (opt_str string_of_int pid) (String.concat ", " files)
+
+(* Command line interface *)
+
+open Cmdliner
+
+let loc_arg =
+ let parse s =
+ try
+ if s <> "" && s.[0] <> '+'
+ then Ok (true, int_of_string s)
+ else Ok (false, int_of_string (String.sub s 1 (String.length s - 1)))
+ with Failure _ -> Error (`Msg "unable to parse integer")
+ in
+ let print ppf p = Format.fprintf ppf "%s" (loc_str p) in
+ Arg.conv ~docv:"N" (parse, print)
+
+let lines =
+ let doc = "Output the last $(docv) lines or use $(i,+)$(docv) to start \
+ output after the $(i,N)-1th line."
+ in
+ Arg.(value & opt loc_arg (true, 10) & info ["n"; "lines"] ~docv:"N" ~doc)
+
+let follow =
+ let doc = "Output appended data as the file grows. $(docv) specifies how \
+ the file should be tracked, by its $(b,name) or by its \
+ $(b,descriptor)."
+ in
+ let follow = Arg.enum ["name", Name; "descriptor", Descriptor] in
+ Arg.(value & opt (some follow) ~vopt:(Some Descriptor) None &
+ info ["f"; "follow"] ~docv:"ID" ~doc)
+
+let verb =
+ let quiet =
+ let doc = "Never output headers giving file names." in
+ Quiet, Arg.info ["q"; "quiet"; "silent"] ~doc
+ in
+ let verbose =
+ let doc = "Always output headers giving file names." in
+ Verbose, Arg.info ["v"; "verbose"] ~doc
+ in
+ Arg.(last & vflag_all [Quiet] [quiet; verbose])
+
+let pid =
+ let doc = "With -f, terminate after process $(docv) dies." in
+ Arg.(value & opt (some int) None & info ["pid"] ~docv:"PID" ~doc)
+
+let files = Arg.(value & (pos_all non_dir_file []) & info [] ~docv:"FILE")
+
+let cmd =
+ let doc = "Display the last part of a file" in
+ let man = [
+ `S Manpage.s_description;
+ `P "$(tname) prints the last lines of each $(i,FILE) to standard output. If
+ no file is specified reads standard input. The number of printed
+ lines can be specified with the $(b,-n) option.";
+ `S Manpage.s_bugs;
+ `P "Report them to .";
+ `S Manpage.s_see_also;
+ `P "$(b,cat)(1), $(b,head)(1)" ]
+ in
+ let info = Cmd.info "tail" ~version:"v1.2.0" ~doc ~man in
+ Cmd.v info Term.(const tail $ lines $ follow $ verb $ pid $ files)
+
+
+let main () = exit (Cmd.eval cmd)
+let () = main ()
+]}
+
+{1:exdarcs A [darcs] command}
+
+We define the command line interface of a [darcs] command with the
+synopsis:
+
+{v
+darcs [COMMAND] …
+v}
+
+The [--debug], [-q], [-v] and [--prehook] options are available in
+each command. To avoid having to pass them individually to each
+command we gather them in a record of type [copts]. By lifting the
+record constructor [copts] into the term [copts_t] we now have a term
+that we can pass to the commands to stand for an argument of type
+[copts]. These options are documented in a section called [COMMON
+OPTIONS], since we also want to put [--help] and [--version] in this
+section, the term information of commands makes a judicious use of the
+[sdocs] parameter of {!Cmdliner.Term.val-info}.
+
+The [help] command shows help about commands or other topics. The help
+shown for commands is generated by [Cmdliner] by making an appropriate
+use of {!Cmdliner.Term.val-ret} on the lifted [help] function.
+
+If the program is invoked without a command we just want to show the
+help of the program as printed by [Cmdliner] with [--help]. This is
+done by the [default_cmd] term.
+
+{[
+(* Implementations, just print the args. *)
+
+type verb = Normal | Quiet | Verbose
+type copts = { debug : bool; verb : verb; prehook : string option }
+
+let str = Printf.sprintf
+let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
+let opt_str_str = opt_str (fun s -> s)
+let verb_str = function
+ | Normal -> "normal" | Quiet -> "quiet" | Verbose -> "verbose"
+
+let pr_copts oc copts = Printf.fprintf oc
+ "debug = %B\nverbosity = %s\nprehook = %s\n"
+ copts.debug (verb_str copts.verb) (opt_str_str copts.prehook)
+
+let initialize copts repodir = Printf.printf
+ "%arepodir = %s\n" pr_copts copts repodir
+
+let record copts name email all ask_deps files = Printf.printf
+ "%aname = %s\nemail = %s\nall = %B\nask-deps = %B\nfiles = %s\n"
+ pr_copts copts (opt_str_str name) (opt_str_str email) all ask_deps
+ (String.concat ", " files)
+
+let help copts man_format cmds topic = match topic with
+| None -> `Help (`Pager, None) (* help about the program. *)
+| Some topic ->
+ let topics = "topics" :: "patterns" :: "environment" :: cmds in
+ let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
+ match conv topic with
+ | `Error e -> `Error (false, e)
+ | `Ok t when t = "topics" -> List.iter print_endline topics; `Ok ()
+ | `Ok t when List.mem t cmds -> `Help (man_format, Some t)
+ | `Ok t ->
+ let page = (topic, 7, "", "", ""), [`S topic; `P "Say something";] in
+ `Ok (Cmdliner.Manpage.print man_format Format.std_formatter page)
+
+open Cmdliner
+
+(* Help sections common to all commands *)
+
+let help_secs = [
+ `S Manpage.s_common_options;
+ `P "These options are common to all commands.";
+ `S "MORE HELP";
+ `P "Use $(mname) $(i,COMMAND) --help for help on a single command.";`Noblank;
+ `P "Use $(mname) $(b,help patterns) for help on patch matching."; `Noblank;
+ `P "Use $(mname) $(b,help environment) for help on environment variables.";
+ `S Manpage.s_bugs; `P "Check bug reports at http://bugs.example.org.";]
+
+(* Options common to all commands *)
+
+let copts debug verb prehook = { debug; verb; prehook }
+let copts_t =
+ let docs = Manpage.s_common_options in
+ let debug =
+ let doc = "Give only debug output." in
+ Arg.(value & flag & info ["debug"] ~docs ~doc)
+ in
+ let verb =
+ let doc = "Suppress informational output." in
+ let quiet = Quiet, Arg.info ["q"; "quiet"] ~docs ~doc in
+ let doc = "Give verbose output." in
+ let verbose = Verbose, Arg.info ["v"; "verbose"] ~docs ~doc in
+ Arg.(last & vflag_all [Normal] [quiet; verbose])
+ in
+ let prehook =
+ let doc = "Specify command to run before this $(mname) command." in
+ Arg.(value & opt (some string) None & info ["prehook"] ~docs ~doc)
+ in
+ Term.(const copts $ debug $ verb $ prehook)
+
+(* Commands *)
+
+let sdocs = Manpage.s_common_options
+
+let initialize_cmd =
+ let repodir =
+ let doc = "Run the program in repository directory $(docv)." in
+ Arg.(value & opt file Filename.current_dir_name & info ["repodir"]
+ ~docv:"DIR" ~doc)
+ in
+ let doc = "make the current directory a repository" in
+ let man = [
+ `S Manpage.s_description;
+ `P "Turns the current directory into a Darcs repository. Any
+ existing files and subdirectories become …";
+ `Blocks help_secs; ]
+ in
+ let info = Cmd.info "initialize" ~doc ~sdocs ~man in
+ Cmd.v info Term.(const initialize $ copts_t $ repodir)
+
+let record_cmd =
+ let pname =
+ let doc = "Name of the patch." in
+ Arg.(value & opt (some string) None & info ["m"; "patch-name"] ~docv:"NAME"
+ ~doc)
+ in
+ let author =
+ let doc = "Specifies the author's identity." in
+ Arg.(value & opt (some string) None & info ["A"; "author"] ~docv:"EMAIL"
+ ~doc)
+ in
+ let all =
+ let doc = "Answer yes to all patches." in
+ Arg.(value & flag & info ["a"; "all"] ~doc)
+ in
+ let ask_deps =
+ let doc = "Ask for extra dependencies." in
+ Arg.(value & flag & info ["ask-deps"] ~doc)
+ in
+ let files = Arg.(value & (pos_all file) [] & info [] ~docv:"FILE or DIR") in
+ let doc = "create a patch from unrecorded changes" in
+ let man =
+ [`S Manpage.s_description;
+ `P "Creates a patch from changes in the working tree. If you specify
+ a set of files …";
+ `Blocks help_secs; ]
+ in
+ let info = Cmd.info "record" ~doc ~sdocs ~man in
+ Cmd.v info
+ Term.(const record $ copts_t $ pname $ author $ all $ ask_deps $ files)
+
+let help_cmd =
+ let topic =
+ let doc = "The topic to get help on. $(b,topics) lists the topics." in
+ Arg.(value & pos 0 (some string) None & info [] ~docv:"TOPIC" ~doc)
+ in
+ let doc = "display help about darcs and darcs commands" in
+ let man =
+ [`S Manpage.s_description;
+ `P "Prints help about darcs commands and other subjects…";
+ `Blocks help_secs; ]
+ in
+ let info = Cmd.info "help" ~doc ~man in
+ Cmd.v info
+ Term.(ret (const help $ copts_t $ Arg.man_format $ Term.choice_names $
+ topic))
+
+let main_cmd =
+ let doc = "a revision control system" in
+ let man = help_secs in
+ let info = Cmd.info "darcs" ~version:"v1.2.0" ~doc ~sdocs ~man in
+ let default = Term.(ret (const (fun _ -> `Help (`Pager, None)) $ copts_t)) in
+ Cmd.group info ~default [initialize_cmd; record_cmd; help_cmd]
+
+let () = exit (Cmd.eval main_cmd)
+]}
diff --git a/cmdliner/_doc-dir/odoc-pages/index.mld b/cmdliner/_doc-dir/odoc-pages/index.mld
new file mode 100755
index 00000000..962dd49f
--- /dev/null
+++ b/cmdliner/_doc-dir/odoc-pages/index.mld
@@ -0,0 +1,34 @@
+{0 Cmdliner {%html: v1.2.0%}}
+
+[Cmdliner] provides a simple and compositional mechanism
+to convert command line arguments to OCaml values and pass them to
+your functions.
+
+The library automatically handles syntax errors, help messages and
+UNIX man page generation. It supports programs with single or multiple
+commands (like [git]) and respect most of the
+{{:http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html}
+POSIX} and
+{{:http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html}
+GNU} conventions.
+
+{1:manuals Manuals}
+
+The following manuals are available.
+
+{ul
+{- The {{!page-tutorial}tutorial} gets you through the steps to write
+ your first command line interface with Cmdliner.}
+{- The {{!page-cli}Command line interface manual} describes how command
+ lines and environment variables are parsed by Cmdliner.}
+{- {{!page-tool_man}Tool man pages} describes how Cmdliner generates
+ man pages for your tools and how you can format them.}
+{- The {{!page-examples}examples page} has a few annoted examples that
+ show to express the command line interface of a few classic tools with
+ Cmdliner}}
+
+{1:api API}
+
+{!modules:
+Cmdliner
+}
diff --git a/cmdliner/_doc-dir/odoc-pages/tool_man.mld b/cmdliner/_doc-dir/odoc-pages/tool_man.mld
new file mode 100755
index 00000000..7029d346
--- /dev/null
+++ b/cmdliner/_doc-dir/odoc-pages/tool_man.mld
@@ -0,0 +1,70 @@
+{0:tool_man Tool man pages}
+
+{1:manual Manual}
+
+Man page sections for a command are printed in the order specified by
+manual as given to {!Cmdliner.Cmd.val-info}. Unless specified
+explicitly in the command's manual the following sections are
+automatically created and populated for you:
+
+{ul
+{- {{!Cmdliner.Manpage.s_name}[NAME]} section.}
+{- {{!Cmdliner.Manpage.s_synopsis}[SYNOPSIS]} section.}}
+
+The various [doc] documentation strings specified by the command's
+term arguments get inserted at the end of the documentation section
+they respectively mention in their [docs] argument:
+
+{ol
+{- For commands, see {!Cmdliner.Cmd.val-info}.}
+{- For positional arguments, see {!Cmdliner.Arg.type-info}. Those are listed iff
+ both the [docv] and [doc] string is specified by {!Cmdliner.Arg.val-info}.}
+{- For optional arguments, see {!Cmdliner.Arg.val-info}.}
+{- For exit statuses, see {!Cmdliner.Cmd.Exit.val-info}.}
+{- For environment variables, see
+ {!Cmdliner.Arg.val-env_var} and {!Cmdliner.Cmd.Env.val-info}.}}
+
+If a [docs] section name is mentioned and does not exist in the command's
+manual, an empty section is created for it, after which the [doc] strings
+are inserted, possibly prefixed by boilerplate text (e.g. for
+{!Cmdliner.Manpage.s_environment} and {!Cmdliner.Manpage.s_exit_status}).
+
+If the created section is:
+{ul
+{- {{!Cmdliner.Manpage.standard_sections}standard}, it
+ is inserted at the right place in the order specified
+ {{!Cmdliner.Manpage.standard_sections}here}, but after a
+ possible non-standard
+ section explicitly specified by the command's manual since the latter
+ get the order number of the last previously specified standard section
+ or the order of {!Cmdliner.Manpage.s_synopsis} if there is no such section.}
+{- non-standard, it is inserted before the {!Cmdliner.Manpage.s_commands}
+ section or the first subsequent existing standard section if it
+ doesn't exist. Taking advantage of this behaviour is discouraged,
+ you should declare manually your non standard section in the command's
+ manual page.}}
+
+Finally note that the header of empty sections are dropped from the
+output. This allows you to share section placements among many
+commands and render them only if something actually gets inserted in
+it.
+
+{1:doclang Documentation markup language}
+
+Manpage {{!Cmdliner.Manpage.block}blocks} and doc strings support the
+following markup language.
+
+{ul
+{- Markup directives [$(i,text)] and [$(b,text)], where [text] is raw
+ text respectively rendered in italics and bold.}
+{- Outside markup directives, context dependent variables of the form
+ [$(var)] are substituted by marked up data. For example in a term's
+ man page [$(tname)] is substituted by the term name in bold.}
+{- Characters $, (, ) and \ can respectively be escaped by \$, \(, \)
+ and \\ (in OCaml strings this will be ["\\$"], ["\\("], ["\\)"],
+ ["\\\\"]). Escaping $ and \ is mandatory everywhere. Escaping ) is
+ mandatory only in markup directives. Escaping ( is only here for
+ your symmetric pleasure. Any other sequence of characters starting
+ with a \ is an illegal character sequence.}
+{- Referring to unknown markup directives or variables will generate
+ errors on standard error during documentation generation.}}
diff --git a/cmdliner/_doc-dir/odoc-pages/tutorial.mld b/cmdliner/_doc-dir/odoc-pages/tutorial.mld
new file mode 100755
index 00000000..a950e664
--- /dev/null
+++ b/cmdliner/_doc-dir/odoc-pages/tutorial.mld
@@ -0,0 +1,203 @@
+{0:tutorial Tutorial}
+
+{1:started Getting started}
+
+With [Cmdliner] your tool's [main] function evaluates a command.
+
+A command is a value of type {!Cmdliner.Cmd.t} which gathers a command
+name and a term of type {!Cmdliner.Term.t}. A term is an expression to
+be evaluated. The type parameter of the term (and the command)
+indicates the type of the result of the evaluation.
+
+One way to create terms is by lifting regular OCaml values with
+{!Cmdliner.Term.const}. Terms can be applied to terms evaluating to
+functional values with {!Cmdliner.Term.($)}.
+
+For example, in a [revolt.ml] file, for the function:
+
+{[
+let revolt () = print_endline "Revolt!"
+]}
+
+the term :
+
+{[
+open Cmdliner
+
+let revolt_t = Term.(const revolt $ const ())
+]}
+
+is a term that evaluates to the result (and effect) of the [revolt]
+function. This term can be attached to a command:
+
+{[
+let cmd = Cmd.v (Cmd.info "revolt") revolt_t
+]}
+
+and evaluated with {!Cmdliner.Cmd.val-eval}:
+{[
+let () = exit (Cmd.eval cmd)
+]}
+
+This defines a command line tool named ["revolt"] (this name will be
+used in error reporting and documentation generation), without command
+line arguments, that just prints ["Revolt!"] on [stdout].
+
+{[
+> ocamlfind ocamlopt -linkpkg -package cmdliner -o revolt revolt.ml
+> ./revolt
+Revolt!
+]}
+
+The combinators in the {!Cmdliner.Arg} module allow to extract command
+line arguments as terms. These terms can then be applied to lifted
+OCaml functions to be evaluated.
+
+Terms corresponding to command line argument data that are part of a
+term evaluation implicitly define a command line syntax. We show this
+on an concrete example.
+
+In a [chorus.ml] file, consider the [chorus] function that prints
+repeatedly a given message :
+
+{[
+let chorus count msg = for i = 1 to count do print_endline msg done
+]}
+
+we want to make it available from the command line with the synopsis:
+
+{[
+chorus [-c COUNT | --count=COUNT] [MSG]
+]}
+
+where [COUNT] defaults to [10] and [MSG] defaults to ["Revolt!"]. We
+first define a term corresponding to the [--count] option:
+
+{[
+let count =
+ let doc = "Repeat the message $(docv) times." in
+ Arg.(value & opt int 10 & info ["c"; "count"] ~docv:"COUNT" ~doc)
+]}
+
+This says that [count] is a term that evaluates to the value of an
+optional argument of type [int] that defaults to [10] if unspecified
+and whose option name is either [-c] or [--count]. The arguments [doc]
+and [docv] are used to generate the option's man page information.
+
+The term for the positional argument [MSG] is:
+
+{[
+let msg =
+ let env =
+ let doc = "Overrides the default message to print." in
+ Cmd.Env.info "CHORUS_MSG" ~doc
+ in
+ let doc = "The message to print." in
+ Arg.(value & pos 0 string "Revolt!" & info [] ~env ~docv:"MSG" ~doc)
+]}
+
+which says that [msg] is a term whose value is the positional argument
+at index [0] of type [string] and defaults to ["Revolt!"] or the
+value of the environment variable [CHORUS_MSG] if the argument is
+unspecified on the command line. Here again [doc] and [docv] are used
+for the man page information.
+
+The term for executing [chorus] with these command line arguments is :
+
+{[
+let chorus_t = Term.(const chorus $ count $ msg)
+]}
+
+We are now ready to define the [main] function of our tool:
+
+{[
+let cmd =
+ let doc = "print a customizable message repeatedly" in
+ let man = [
+ `S Manpage.s_bugs;
+ `P "Email bug reports to ." ]
+ in
+ let info = Cmd.info "chorus" ~version:"%%VERSION%%" ~doc ~man in
+ Cmd.v info chorus_t
+
+let main () = exit (Cmd.eval cmd)
+let () = main ()
+]}
+
+The [info] value created with {!Cmdliner.Cmd.val-info} gives more
+information about the term we execute and is used to generate the
+tool's man page. Since we provided a [~version] string, the tool
+will automatically respond to the [--version] option by printing this
+string.
+
+A tool using {!Cmdliner.Cmd.val-eval} always responds to the [--help]
+option by showing the tool's man page generated using the information
+you provided with {!Cmdliner.Cmd.val-info} and
+{!Cmdliner.Arg.val-info}. Here is the output generated by our
+example:
+
+{v
+> ocamlfind ocamlopt -linkpkg -package cmdliner -o chorus chorus.ml
+> ./chorus --help
+NAME
+ chorus - Print a customizable message repeatedly
+
+SYNOPSIS
+ chorus [--count=COUNT] [OPTION]… [MSG]
+
+ARGUMENTS
+ MSG (absent=Revolt! or CHORUS_MSG env)
+ The message to print.
+
+OPTIONS
+ -c COUNT, --count=COUNT (absent=10)
+ Repeat the message COUNT times.
+
+COMMON OPTIONS
+ --help[=FMT] (default=auto)
+ Show this help in format FMT. The value FMT must be one of auto,
+ pager, groff or plain. With auto, the format is pager or plain
+ whenever the TERM env var is dumb or undefined.
+
+ --version
+ Show version information.
+
+EXIT STATUS
+ chorus exits with the following status:
+
+ 0 on success.
+
+ 123 on indiscriminate errors reported on standard error.
+
+ 124 on command line parsing errors.
+
+ 125 on unexpected internal errors (bugs).
+
+ENVIRONMENT
+ These environment variables affect the execution of chorus:
+
+ CHORUS_MSG
+ Overrides the default message to print.
+
+BUGS
+ Email bug reports to .
+v}
+
+If a pager is available, this output is written to a pager. This help
+is also available in plain text or in the
+{{:http://www.gnu.org/software/groff/groff.html}groff} man page format
+by invoking the program with the option [--help=plain] or
+[--help=groff].
+
+For examples of more complex command line definitions look and run
+the {{!page-examples}examples}.
+
+{1:subcommands Sub commands}
+
+[Cmdliner] also provides support for programs like [git] that have sub
+commands each with their own command line syntax and manual:
+
+{[tool [COMMAND]… [OPTION]… ARG…]}
+
+These sub commands are defined by grouping them under a parent command
+via the {!Cmdliner.Cmd.group} function.
diff --git a/cmdliner/cli.html b/cmdliner/cli.html
new file mode 100644
index 00000000..95f41a5d
--- /dev/null
+++ b/cmdliner/cli.html
@@ -0,0 +1,2 @@
+
+cli (cmdliner.cli)
Command line interface
For tools evaluating a command without sub commands the most general form of invocation is:
tool [OPTION]… [ARG]…
The tool automatically reponds to the --help option by printing the help. If a version string is provided in the command information, it also automatically responds to the --version option by printing this string on standard output.
Command line arguments are either optional or positional. Both can be freely interleaved but since Cmdliner accepts many optional forms this may result in ambiguities. The special token -- can be used to resolve them; anything that follows it is treated as a positional argument.
Tools evaluating commands with sub commands have this form of invocation
tool [COMMAND]… [OPTION]… [ARG]…
Commands automatically respond to the --help option by printing their help. The sequence of COMMAND strings must be the first strings following the tool name – as soon as an optional argument is seen the search for a sub command stops. Command names may be specified by a prefixe as long as they are not ambiguous.
Optional arguments
An optional argument is specified on the command line by a name possibly followed by a value.
The name of an option can be short or long.
A short name is a dash followed by a single alphanumeric character: -h, -q, -I.
A long name is two dashes followed by alphanumeric characters and dashes: --help, --silent, --ignore-case.
More than one name may refer to the same optional argument. For example in a given program the names -q, --quiet and --silent may all stand for the same boolean argument indicating the program to be quiet. Long names can be specified by any non ambiguous prefix.
The value of an option can be specified in three different ways.
As the next token on the command line: -o a.out, --output a.out.
Glued to a short name: -oa.out.
Glued to a long name after an equal character: --output=a.out.
Glued forms are especially useful if the value itself starts with a dash as is the case for negative numbers, --min=-10.
Short flags can be grouped together to share a single dash and the group can end with a short option. For example assuming -v and -x are flags and -f is a short option:
-vx will be parsed as -v -x.
-vxfopt will be parsed as -v -x -fopt.
-vxf opt will be parsed as -v -x -fopt.
-fvx will be parsed as -f=vx.
Positional arguments
Positional arguments are tokens on the command line that are not option names and are not the value of an optional argument. They are numbered from left to right starting with zero.
Since positional arguments may be mistaken as the optional value of an optional argument or they may need to look like option names, anything that follows the special token "--" on the command line is considered to be a positional argument:
tool --option -- we -are --all positional --argu=ments
Environment variables
Non-required command line arguments can be backed up by an environment variable. If the argument is absent from the command line and that the environment variable is defined, its value is parsed using the argument converter and defines the value of the argument.
For Cmdliner.Arg.flag and Cmdliner.Arg.flag_all that do not have an argument converter a boolean is parsed from the lowercased variable value as follows:
Using the cmdliner library puts the following constraints o
The option name --cmdliner is reserved by the library.
The option name --help, (and --version if you specify a version string) is reserved by the library. Using it as a term or option name may result in undefined behaviour.
Defining the same option or command name via two different arguments or terms is illegal and raises Invalid_argument.
The examples are self-contained, cut and paste them in a file to play with them.
A rm command
We define the command line interface of an rm command with the synopsis:
rm [OPTION]… FILE…
The -f, -i and -I flags define the prompt behaviour of rm. It is represented in our program by the prompt type. If more than one of these flags is present on the command line the last one takes precedence.
To implement this behaviour we map the presence of these flags to values of the prompt type by using Cmdliner.Arg.vflag_all.
This argument will contain all occurrences of the flag on the command line and we just take the Cmdliner.Arg.last one to define our term value. If there is no occurrence the last value of the default list [Always] is taken. This means the default prompt behaviour is Always.
(* Implementation of the command, we just print the args. *)
+
+type prompt = Always | Once | Never
+let prompt_str = function
+| Always -> "always" | Once -> "once" | Never -> "never"
+
+let rm prompt recurse files =
+ Printf.printf "prompt = %s\nrecurse = %B\nfiles = %s\n"
+ (prompt_str prompt) recurse (String.concat ", " files)
+
+(* Command line interface *)
+
+open Cmdliner
+
+let files = Arg.(non_empty & pos_all file [] & info [] ~docv:"FILE")
+let prompt =
+ let always =
+ let doc = "Prompt before every removal." in
+ Always, Arg.info ["i"] ~doc
+ in
+ let never =
+ let doc = "Ignore nonexistent files and never prompt." in
+ Never, Arg.info ["f"; "force"] ~doc
+ in
+ let once =
+ let doc = "Prompt once before removing more than three files, or when
+ removing recursively. Less intrusive than $(b,-i), while
+ still giving protection against most mistakes."
+ in
+ Once, Arg.info ["I"] ~doc
+ in
+ Arg.(last & vflag_all [Always] [always; never; once])
+
+let recursive =
+ let doc = "Remove directories and their contents recursively." in
+ Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)
+
+let cmd =
+ let doc = "Remove files or directories" in
+ let man = [
+ `S Manpage.s_description;
+ `P "$(tname) removes each specified $(i,FILE). By default it does not
+ remove directories, to also remove them and their contents, use the
+ option $(b,--recursive) ($(b,-r) or $(b,-R)).";
+ `P "To remove a file whose name starts with a $(b,-), for example
+ $(b,-foo), use one of these commands:";
+ `Pre "$(mname) $(b,-- -foo)"; `Noblank;
+ `Pre "$(mname) $(b,./-foo)";
+ `P "$(tname) removes symbolic links, not the files referenced by the
+ links.";
+ `S Manpage.s_bugs; `P "Report bugs to <bugs@example.org>.";
+ `S Manpage.s_see_also; `P "$(b,rmdir)(1), $(b,unlink)(2)" ]
+ in
+ let info = Cmd.info "rm" ~version:"v1.2.0" ~doc ~man in
+ Cmd.v info Term.(const rm $ prompt $ recursive $ files)
+
+let main () = exit (Cmd.eval cmd)
+let () = main ()
A cp command
We define the command line interface of a cp command with the synopsis:
cp [OPTION]… SOURCE… DEST
The DEST argument must be a directory if there is more than one SOURCE. This constraint is too complex to be expressed by the combinators of Cmdliner.Arg.
Hence we just give DEST the Cmdliner.Arg.string type and verify the constraint at the beginning of the implementation of cp. If the constraint is unsatisfied we return an `Error result. By using Cmdliner.Term.ret on the lifted result cp_t of cp, Cmdliner handles the error reporting.
(* Implementation, we check the dest argument and print the args *)
+
+let cp verbose recurse force srcs dest =
+ let many = List.length srcs > 1 in
+ if many && (not (Sys.file_exists dest) || not (Sys.is_directory dest))
+ then `Error (false, dest ^ ": not a directory") else
+ `Ok (Printf.printf
+ "verbose = %B\nrecurse = %B\nforce = %B\nsrcs = %s\ndest = %s\n"
+ verbose recurse force (String.concat ", " srcs) dest)
+
+(* Command line interface *)
+
+open Cmdliner
+
+let verbose =
+ let doc = "Print file names as they are copied." in
+ Arg.(value & flag & info ["v"; "verbose"] ~doc)
+
+let recurse =
+ let doc = "Copy directories recursively." in
+ Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)
+
+let force =
+ let doc = "If a destination file cannot be opened, remove it and try again."in
+ Arg.(value & flag & info ["f"; "force"] ~doc)
+
+let srcs =
+ let doc = "Source file(s) to copy." in
+ Arg.(non_empty & pos_left ~rev:true 0 file [] & info [] ~docv:"SOURCE" ~doc)
+
+let dest =
+ let doc = "Destination of the copy. Must be a directory if there is more \
+ than one $(i,SOURCE)." in
+ let docv = "DEST" in
+ Arg.(required & pos ~rev:true 0 (some string) None & info [] ~docv ~doc)
+
+let cmd =
+ let doc = "Copy files" in
+ let man_xrefs =
+ [ `Tool "mv"; `Tool "scp"; `Page ("umask", 2); `Page ("symlink", 7) ]
+ in
+ let man =
+ [ `S Manpage.s_bugs;
+ `P "Email them to <bugs@example.org>."; ]
+ in
+ let info = Cmd.info "cp" ~version:"v1.2.0" ~doc ~man ~man_xrefs in
+ Cmd.v info Term.(ret (const cp $ verbose $ recurse $ force $ srcs $ dest))
+
+
+let main () = exit (Cmd.eval cmd)
+let () = main ()
A tail command
We define the command line interface of a tail command with the synopsis:
tail [OPTION]… [FILE]…
The --lines option whose value specifies the number of last lines to print has a special syntax where a + prefix indicates to start printing from that line number. In the program this is represented by the loc type. We define a custom loc_argargument converter for this option.
The --follow option has an optional enumerated value. The argument converter follow, created with Cmdliner.Arg.enum parses the option value into the enumeration. By using Cmdliner.Arg.some and the ~vopt argument of Cmdliner.Arg.opt, the term corresponding to the option --follow evaluates to None if --follow is absent from the command line, to Some Descriptor if present but without a value and to Some v if present with a value v specified.
(* Implementation of the command, we just print the args. *)
+
+type loc = bool * int
+type verb = Verbose | Quiet
+type follow = Name | Descriptor
+
+let str = Printf.sprintf
+let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
+let loc_str (rev, k) = if rev then str "%d" k else str "+%d" k
+let follow_str = function Name -> "name" | Descriptor -> "descriptor"
+let verb_str = function Verbose -> "verbose" | Quiet -> "quiet"
+
+let tail lines follow verb pid files =
+ Printf.printf
+ "lines = %s\nfollow = %s\nverb = %s\npid = %s\nfiles = %s\n"
+ (loc_str lines) (opt_str follow_str follow) (verb_str verb)
+ (opt_str string_of_int pid) (String.concat ", " files)
+
+(* Command line interface *)
+
+open Cmdliner
+
+let loc_arg =
+ let parse s =
+ try
+ if s <> "" && s.[0] <> '+'
+ then Ok (true, int_of_string s)
+ else Ok (false, int_of_string (String.sub s 1 (String.length s - 1)))
+ with Failure _ -> Error (`Msg "unable to parse integer")
+ in
+ let print ppf p = Format.fprintf ppf "%s" (loc_str p) in
+ Arg.conv ~docv:"N" (parse, print)
+
+let lines =
+ let doc = "Output the last $(docv) lines or use $(i,+)$(docv) to start \
+ output after the $(i,N)-1th line."
+ in
+ Arg.(value & opt loc_arg (true, 10) & info ["n"; "lines"] ~docv:"N" ~doc)
+
+let follow =
+ let doc = "Output appended data as the file grows. $(docv) specifies how \
+ the file should be tracked, by its $(b,name) or by its \
+ $(b,descriptor)."
+ in
+ let follow = Arg.enum ["name", Name; "descriptor", Descriptor] in
+ Arg.(value & opt (some follow) ~vopt:(Some Descriptor) None &
+ info ["f"; "follow"] ~docv:"ID" ~doc)
+
+let verb =
+ let quiet =
+ let doc = "Never output headers giving file names." in
+ Quiet, Arg.info ["q"; "quiet"; "silent"] ~doc
+ in
+ let verbose =
+ let doc = "Always output headers giving file names." in
+ Verbose, Arg.info ["v"; "verbose"] ~doc
+ in
+ Arg.(last & vflag_all [Quiet] [quiet; verbose])
+
+let pid =
+ let doc = "With -f, terminate after process $(docv) dies." in
+ Arg.(value & opt (some int) None & info ["pid"] ~docv:"PID" ~doc)
+
+let files = Arg.(value & (pos_all non_dir_file []) & info [] ~docv:"FILE")
+
+let cmd =
+ let doc = "Display the last part of a file" in
+ let man = [
+ `S Manpage.s_description;
+ `P "$(tname) prints the last lines of each $(i,FILE) to standard output. If
+ no file is specified reads standard input. The number of printed
+ lines can be specified with the $(b,-n) option.";
+ `S Manpage.s_bugs;
+ `P "Report them to <bugs@example.org>.";
+ `S Manpage.s_see_also;
+ `P "$(b,cat)(1), $(b,head)(1)" ]
+ in
+ let info = Cmd.info "tail" ~version:"v1.2.0" ~doc ~man in
+ Cmd.v info Term.(const tail $ lines $ follow $ verb $ pid $ files)
+
+
+let main () = exit (Cmd.eval cmd)
+let () = main ()
A darcs command
We define the command line interface of a darcs command with the synopsis:
darcs [COMMAND] …
The --debug, -q, -v and --prehook options are available in each command. To avoid having to pass them individually to each command we gather them in a record of type copts. By lifting the record constructor copts into the term copts_t we now have a term that we can pass to the commands to stand for an argument of type copts. These options are documented in a section called COMMON
+OPTIONS, since we also want to put --help and --version in this section, the term information of commands makes a judicious use of the sdocs parameter of Cmdliner.Term.info.
The help command shows help about commands or other topics. The help shown for commands is generated by Cmdliner by making an appropriate use of Cmdliner.Term.ret on the lifted help function.
If the program is invoked without a command we just want to show the help of the program as printed by Cmdliner with --help. This is done by the default_cmd term.
(* Implementations, just print the args. *)
+
+type verb = Normal | Quiet | Verbose
+type copts = { debug : bool; verb : verb; prehook : string option }
+
+let str = Printf.sprintf
+let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
+let opt_str_str = opt_str (fun s -> s)
+let verb_str = function
+ | Normal -> "normal" | Quiet -> "quiet" | Verbose -> "verbose"
+
+let pr_copts oc copts = Printf.fprintf oc
+ "debug = %B\nverbosity = %s\nprehook = %s\n"
+ copts.debug (verb_str copts.verb) (opt_str_str copts.prehook)
+
+let initialize copts repodir = Printf.printf
+ "%arepodir = %s\n" pr_copts copts repodir
+
+let record copts name email all ask_deps files = Printf.printf
+ "%aname = %s\nemail = %s\nall = %B\nask-deps = %B\nfiles = %s\n"
+ pr_copts copts (opt_str_str name) (opt_str_str email) all ask_deps
+ (String.concat ", " files)
+
+let help copts man_format cmds topic = match topic with
+| None -> `Help (`Pager, None) (* help about the program. *)
+| Some topic ->
+ let topics = "topics" :: "patterns" :: "environment" :: cmds in
+ let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
+ match conv topic with
+ | `Error e -> `Error (false, e)
+ | `Ok t when t = "topics" -> List.iter print_endline topics; `Ok ()
+ | `Ok t when List.mem t cmds -> `Help (man_format, Some t)
+ | `Ok t ->
+ let page = (topic, 7, "", "", ""), [`S topic; `P "Say something";] in
+ `Ok (Cmdliner.Manpage.print man_format Format.std_formatter page)
+
+open Cmdliner
+
+(* Help sections common to all commands *)
+
+let help_secs = [
+ `S Manpage.s_common_options;
+ `P "These options are common to all commands.";
+ `S "MORE HELP";
+ `P "Use $(mname) $(i,COMMAND) --help for help on a single command.";`Noblank;
+ `P "Use $(mname) $(b,help patterns) for help on patch matching."; `Noblank;
+ `P "Use $(mname) $(b,help environment) for help on environment variables.";
+ `S Manpage.s_bugs; `P "Check bug reports at http://bugs.example.org.";]
+
+(* Options common to all commands *)
+
+let copts debug verb prehook = { debug; verb; prehook }
+let copts_t =
+ let docs = Manpage.s_common_options in
+ let debug =
+ let doc = "Give only debug output." in
+ Arg.(value & flag & info ["debug"] ~docs ~doc)
+ in
+ let verb =
+ let doc = "Suppress informational output." in
+ let quiet = Quiet, Arg.info ["q"; "quiet"] ~docs ~doc in
+ let doc = "Give verbose output." in
+ let verbose = Verbose, Arg.info ["v"; "verbose"] ~docs ~doc in
+ Arg.(last & vflag_all [Normal] [quiet; verbose])
+ in
+ let prehook =
+ let doc = "Specify command to run before this $(mname) command." in
+ Arg.(value & opt (some string) None & info ["prehook"] ~docs ~doc)
+ in
+ Term.(const copts $ debug $ verb $ prehook)
+
+(* Commands *)
+
+let sdocs = Manpage.s_common_options
+
+let initialize_cmd =
+ let repodir =
+ let doc = "Run the program in repository directory $(docv)." in
+ Arg.(value & opt file Filename.current_dir_name & info ["repodir"]
+ ~docv:"DIR" ~doc)
+ in
+ let doc = "make the current directory a repository" in
+ let man = [
+ `S Manpage.s_description;
+ `P "Turns the current directory into a Darcs repository. Any
+ existing files and subdirectories become …";
+ `Blocks help_secs; ]
+ in
+ let info = Cmd.info "initialize" ~doc ~sdocs ~man in
+ Cmd.v info Term.(const initialize $ copts_t $ repodir)
+
+let record_cmd =
+ let pname =
+ let doc = "Name of the patch." in
+ Arg.(value & opt (some string) None & info ["m"; "patch-name"] ~docv:"NAME"
+ ~doc)
+ in
+ let author =
+ let doc = "Specifies the author's identity." in
+ Arg.(value & opt (some string) None & info ["A"; "author"] ~docv:"EMAIL"
+ ~doc)
+ in
+ let all =
+ let doc = "Answer yes to all patches." in
+ Arg.(value & flag & info ["a"; "all"] ~doc)
+ in
+ let ask_deps =
+ let doc = "Ask for extra dependencies." in
+ Arg.(value & flag & info ["ask-deps"] ~doc)
+ in
+ let files = Arg.(value & (pos_all file) [] & info [] ~docv:"FILE or DIR") in
+ let doc = "create a patch from unrecorded changes" in
+ let man =
+ [`S Manpage.s_description;
+ `P "Creates a patch from changes in the working tree. If you specify
+ a set of files …";
+ `Blocks help_secs; ]
+ in
+ let info = Cmd.info "record" ~doc ~sdocs ~man in
+ Cmd.v info
+ Term.(const record $ copts_t $ pname $ author $ all $ ask_deps $ files)
+
+let help_cmd =
+ let topic =
+ let doc = "The topic to get help on. $(b,topics) lists the topics." in
+ Arg.(value & pos 0 (some string) None & info [] ~docv:"TOPIC" ~doc)
+ in
+ let doc = "display help about darcs and darcs commands" in
+ let man =
+ [`S Manpage.s_description;
+ `P "Prints help about darcs commands and other subjects…";
+ `Blocks help_secs; ]
+ in
+ let info = Cmd.info "help" ~doc ~man in
+ Cmd.v info
+ Term.(ret (const help $ copts_t $ Arg.man_format $ Term.choice_names $
+ topic))
+
+let main_cmd =
+ let doc = "a revision control system" in
+ let man = help_secs in
+ let info = Cmd.info "darcs" ~version:"v1.2.0" ~doc ~sdocs ~man in
+ let default = Term.(ret (const (fun _ -> `Help (`Pager, None)) $ copts_t)) in
+ Cmd.group info ~default [initialize_cmd; record_cmd; help_cmd]
+
+let () = exit (Cmd.eval main_cmd)
Cmdliner provides a simple and compositional mechanism to convert command line arguments to OCaml values and pass them to your functions.
The library automatically handles syntax errors, help messages and UNIX man page generation. It supports programs with single or multiple commands (like git) and respect most of the POSIX and GNU conventions.
Manuals
The following manuals are available.
The tutorial gets you through the steps to write your first command line interface with Cmdliner.
Man page sections for a command are printed in the order specified by manual as given to Cmdliner.Cmd.info. Unless specified explicitly in the command's manual the following sections are automatically created and populated for you:
The various doc documentation strings specified by the command's term arguments get inserted at the end of the documentation section they respectively mention in their docs argument:
If a docs section name is mentioned and does not exist in the command's manual, an empty section is created for it, after which the doc strings are inserted, possibly prefixed by boilerplate text (e.g. for Cmdliner.Manpage.s_environment and Cmdliner.Manpage.s_exit_status).
If the created section is:
standard, it is inserted at the right place in the order specified here, but after a possible non-standard section explicitly specified by the command's manual since the latter get the order number of the last previously specified standard section or the order of Cmdliner.Manpage.s_synopsis if there is no such section.
non-standard, it is inserted before the Cmdliner.Manpage.s_commands section or the first subsequent existing standard section if it doesn't exist. Taking advantage of this behaviour is discouraged, you should declare manually your non standard section in the command's manual page.
Finally note that the header of empty sections are dropped from the output. This allows you to share section placements among many commands and render them only if something actually gets inserted in it.
Documentation markup language
Manpage blocks and doc strings support the following markup language.
Markup directives $(i,text) and $(b,text), where text is raw text respectively rendered in italics and bold.
Outside markup directives, context dependent variables of the form $(var) are substituted by marked up data. For example in a term's man page $(tname) is substituted by the term name in bold.
Characters $, (, ) and \ can respectively be escaped by \$, \(, \) and \\ (in OCaml strings this will be "\\$", "\\(", "\\)", "\\\\"). Escaping $ and \ is mandatory everywhere. Escaping ) is mandatory only in markup directives. Escaping ( is only here for your symmetric pleasure. Any other sequence of characters starting with a \ is an illegal character sequence.
Referring to unknown markup directives or variables will generate errors on standard error during documentation generation.
With Cmdliner your tool's main function evaluates a command.
A command is a value of type Cmdliner.Cmd.t which gathers a command name and a term of type Cmdliner.Term.t. A term is an expression to be evaluated. The type parameter of the term (and the command) indicates the type of the result of the evaluation.
One way to create terms is by lifting regular OCaml values with Cmdliner.Term.const. Terms can be applied to terms evaluating to functional values with Cmdliner.Term.($).
For example, in a revolt.ml file, for the function:
This defines a command line tool named "revolt" (this name will be used in error reporting and documentation generation), without command line arguments, that just prints "Revolt!" on stdout.
The combinators in the Cmdliner.Arg module allow to extract command line arguments as terms. These terms can then be applied to lifted OCaml functions to be evaluated.
Terms corresponding to command line argument data that are part of a term evaluation implicitly define a command line syntax. We show this on an concrete example.
In a chorus.ml file, consider the chorus function that prints repeatedly a given message :
let chorus count msg = for i = 1 to count do print_endline msg done
we want to make it available from the command line with the synopsis:
chorus [-c COUNT | --count=COUNT] [MSG]
where COUNT defaults to 10 and MSG defaults to "Revolt!". We first define a term corresponding to the --count option:
let count =
+ let doc = "Repeat the message $(docv) times." in
+ Arg.(value & opt int 10 & info ["c"; "count"] ~docv:"COUNT" ~doc)
This says that count is a term that evaluates to the value of an optional argument of type int that defaults to 10 if unspecified and whose option name is either -c or --count. The arguments doc and docv are used to generate the option's man page information.
The term for the positional argument MSG is:
let msg =
+ let env =
+ let doc = "Overrides the default message to print." in
+ Cmd.Env.info "CHORUS_MSG" ~doc
+ in
+ let doc = "The message to print." in
+ Arg.(value & pos 0 string "Revolt!" & info [] ~env ~docv:"MSG" ~doc)
which says that msg is a term whose value is the positional argument at index 0 of type string and defaults to "Revolt!" or the value of the environment variable CHORUS_MSG if the argument is unspecified on the command line. Here again doc and docv are used for the man page information.
The term for executing chorus with these command line arguments is :
let chorus_t = Term.(const chorus $ count $ msg)
We are now ready to define the main function of our tool:
let cmd =
+ let doc = "print a customizable message repeatedly" in
+ let man = [
+ `S Manpage.s_bugs;
+ `P "Email bug reports to <bugs@example.org>." ]
+ in
+ let info = Cmd.info "chorus" ~version:"%%VERSION%%" ~doc ~man in
+ Cmd.v info chorus_t
+
+let main () = exit (Cmd.eval cmd)
+let () = main ()
The info value created with Cmdliner.Cmd.info gives more information about the term we execute and is used to generate the tool's man page. Since we provided a ~version string, the tool will automatically respond to the --version option by printing this string.
A tool using Cmdliner.Cmd.eval always responds to the --help option by showing the tool's man page generated using the information you provided with Cmdliner.Cmd.info and Cmdliner.Arg.info. Here is the output generated by our example:
> ocamlfind ocamlopt -linkpkg -package cmdliner -o chorus chorus.ml
+> ./chorus --help
+NAME
+ chorus - Print a customizable message repeatedly
+
+SYNOPSIS
+ chorus [--count=COUNT] [OPTION]… [MSG]
+
+ARGUMENTS
+ MSG (absent=Revolt! or CHORUS_MSG env)
+ The message to print.
+
+OPTIONS
+ -c COUNT, --count=COUNT (absent=10)
+ Repeat the message COUNT times.
+
+COMMON OPTIONS
+ --help[=FMT] (default=auto)
+ Show this help in format FMT. The value FMT must be one of auto,
+ pager, groff or plain. With auto, the format is pager or plain
+ whenever the TERM env var is dumb or undefined.
+
+ --version
+ Show version information.
+
+EXIT STATUS
+ chorus exits with the following status:
+
+ 0 on success.
+
+ 123 on indiscriminate errors reported on standard error.
+
+ 124 on command line parsing errors.
+
+ 125 on unexpected internal errors (bugs).
+
+ENVIRONMENT
+ These environment variables affect the execution of chorus:
+
+ CHORUS_MSG
+ Overrides the default message to print.
+
+BUGS
+ Email bug reports to <bugs@example.org>.
If a pager is available, this output is written to a pager. This help is also available in plain text or in the groff man page format by invoking the program with the option --help=plain or --help=groff.
For examples of more complex command line definitions look and run the examples.
Sub commands
Cmdliner also provides support for programs like git that have sub commands each with their own command line syntax and manual:
tool [COMMAND]… [OPTION]… ARG…
These sub commands are defined by grouping them under a parent command via the Cmdliner.Cmd.group function.
diff --git a/dev/highlight.pack.js b/dev/highlight.pack.js
deleted file mode 100644
index 40370e82..00000000
--- a/dev/highlight.pack.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */
-!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,"&").replace(//g,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return w(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function u(e){s+=""+t(e)+">"}function c(e){("start"===e.event?o:u)(e.node)}for(var l=0,s="",f=[];e.length||r.length;){var g=i();if(s+=n(a.substring(l,g[0].offset)),l=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===l);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return s+n(a.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):x(a.k).forEach(function(e){u(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return l("self"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var c=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=c.length?t(c.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function l(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function p(e,n,t,r){var a=r?"":I.classPrefix,i='',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=l(E,r),e?(B+=e[1],a+=p(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!y[E.sL])return n(k);var t=e?f(E.sL,k,!0,x[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(B+=t.r),e&&(x[E.sL]=t.top),p(t.language,t.value,!1,!0)}function b(){L+=null!=E.sL?d():h(),k=""}function v(e){L+=e.cN?p(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(k+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),b(),t.rB||t.eB||(k=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),b(),a.eE&&(k=n));do E.cN&&(L+=C),E.skip||(B+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),a.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return k+=n,n.length||1}var N=w(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,E=i||N,x={},L="";for(R=E;R!==N;R=R.parent)R.cN&&(L=p(R.cN,"",!0)+L);var k="",B=0;try{for(var M,j,O=0;;){if(E.t.lastIndex=O,M=E.t.exec(t),!M)break;j=m(t.substring(O,M.index),M[0]),O=M.index+j}for(m(t.substr(O)),R=E;R.parent;R=R.parent)R.cN&&(L+=C);return{r:B,value:L,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function g(e,t){t=t||I.languages||x(y);var r={r:0,value:n(e)},a=r;return t.filter(w).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return I.tabReplace||I.useBR?e.replace(M,function(e,n){return I.useBR&&"\n"===e?" ":I.tabReplace?n.replace(/\t/g,I.tabReplace):""}):e}function h(e,n,t){var r=n?L[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function d(e){var n,t,r,o,l,s=i(e);a(s)||(I.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ /g,"\n")):n=e,l=n.textContent,r=s?f(s,l,!0):g(l),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),l)),r.value=p(r.value),e.innerHTML=r.value,e.className=h(e.className,s,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){I=o(I,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,d)}}function m(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)}function N(n,t){var r=y[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function R(){return x(y)}function w(e){return e=(e||"").toLowerCase(),y[e]||y[L[e]]}var E=[],x=Object.keys,y={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="",I={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=d,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("ocaml",function(e){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)",r:0},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"type",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*",r:0},e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});
\ No newline at end of file
diff --git a/dev/index.html b/dev/index.html
deleted file mode 100644
index c433ae86..00000000
--- a/dev/index.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- index
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dev/linol/Linol/Make/class-base_server/index.html b/dev/linol/Linol/Make/class-base_server/index.html
deleted file mode 100644
index 362c82fc..00000000
--- a/dev/linol/Linol/Make/class-base_server/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-base_server (linol.Linol.Make.base_server)
Class Make.base_server
The server baseclass
methodvirtual on_notification : notify_back:(Lsp.Server_notification.t -> unit IO.t) -> Lsp.Client_notification.t -> unit IO.t
methodvirtual on_request : a. 'a Lsp.Client_request.t ->'aIO.t
method must_quit : < must_quit : bool; on_notification : notify_back:(Lsp.Server_notification.t -> unit IO.t) -> Lsp.Client_notification.t -> unit IO.t; on_request : a. 'a Lsp.Client_request.t ->'aIO.t; .. > -> bool
Set to true if the client requested to exit
\ No newline at end of file
diff --git a/dev/linol/Linol/Make/class-notify_back/index.html b/dev/linol/Linol/Make/class-notify_back/index.html
deleted file mode 100644
index 939d3afb..00000000
--- a/dev/linol/Linol/Make/class-notify_back/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-notify_back (linol.Linol.Make.notify_back)
Class Make.notify_back
A wrapper to more easily reply to notifications
method send_log_msg : < send_diagnostic : Lsp.Types.Diagnostic.t list -> unit IO.t; send_log_msg : type_:Lsp__Types.MessageType.t -> string -> unit IO.t; send_notification : Lsp.Server_notification.t -> unit IO.t; .. > -> type_:Lsp__Types.MessageType.t -> string -> unit IO.t
Send a log message to the editor
method send_diagnostic : < send_diagnostic : Lsp.Types.Diagnostic.t list -> unit IO.t; send_log_msg : type_:Lsp__Types.MessageType.t -> string -> unit IO.t; send_notification : Lsp.Server_notification.t -> unit IO.t; .. > -> Lsp.Types.Diagnostic.t list -> unit IO.t
Send diagnostics for the current document
method send_notification : < send_diagnostic : Lsp.Types.Diagnostic.t list -> unit IO.t; send_log_msg : type_:Lsp__Types.MessageType.t -> string -> unit IO.t; send_notification : Lsp.Server_notification.t -> unit IO.t; .. > -> Lsp.Server_notification.t -> unit IO.t
Send a notification (general purpose method)
\ No newline at end of file
diff --git a/dev/linol/Linol/Make/class-server/index.html b/dev/linol/Linol/Make/class-server/index.html
deleted file mode 100644
index 9bfc3938..00000000
--- a/dev/linol/Linol/Make/class-server/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-server (linol.Linol.Make.server)
Class Make.server
An easily overloadable class. Pick the methods you want to support. The user must provide at least the callbacks for document lifecycle: open, close, update. The most basic LSP server should check documents when they're updated and report diagnostics back to the editor.
An easily overloadable class. Pick the methods you want to support. The user must provide at least the callbacks for document lifecycle: open, close, update. The most basic LSP server should check documents when they're updated and report diagnostics back to the editor.
\ No newline at end of file
diff --git a/dev/linol/Linol/index.html b/dev/linol/Linol/index.html
deleted file mode 100644
index 56204b49..00000000
--- a/dev/linol/Linol/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-Linol (linol.Linol)
Module Linol
Linol
Abstraction over The "Lsp" library, to make it easier to develop LSP servers in OCaml (but not necessarily for OCaml).