Skip to content

Commit

Permalink
Documentation for -F flags and -k io api.
Browse files Browse the repository at this point in the history
  • Loading branch information
katef committed Aug 17, 2024
1 parent 7607456 commit a925708
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
13 changes: 13 additions & 0 deletions man/lx.1/lx.1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@

<!ENTITY api_tokbuf.arg "<replaceable>tokbuf</replaceable>">
<!ENTITY api_getc.arg "<replaceable>getc</replaceable>">
<!ENTITY api_io.arg "<replaceable>io</replaceable>">

<!ENTITY n.opt "<option>-n</option>">
<!ENTITY Q.opt "<option>-Q</option>">
<!ENTITY X.opt "<option>-X</option>">
<!ENTITY b.opt "<option>-b</option>&nbsp;&api_tokbuf.arg;">
<!ENTITY g.opt "<option>-g</option>&nbsp;&api_getc.arg;">
<!ENTITY k.opt "<option>-k</option>&nbsp;&api_io.arg;">
<!ENTITY l.opt "<option>-l</option>&nbsp;&lang.arg;">
<!ENTITY e.opt "<option>-e</option>&nbsp;&prefix.arg;">
<!ENTITY t.opt "<option>-t</option>&nbsp;&prefix.arg;">
Expand Down Expand Up @@ -62,6 +64,7 @@
<arg choice="opt">&X.opt;</arg>
<arg choice="opt">&b.opt;</arg>
<arg choice="opt">&g.opt;</arg>
<arg choice="opt">&k.opt;</arg>
<arg choice="opt">&l.opt;</arg>
<arg choice="opt">&e.opt;</arg>
<arg choice="opt">&t.opt;</arg>
Expand Down Expand Up @@ -223,6 +226,16 @@ Dot output is not subject to checks for semantic errors
</listitem>
</varlistentry>

<varlistentry>
<term>&k.opt;</term>

<listitem>
<para>Set the IO &api; for output,
per the <code>io</code> option for &fsm_print.3;.
The default is <literal>getc</literal>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>&e.opt;</term>

Expand Down
69 changes: 69 additions & 0 deletions man/re.1/re.1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
<!ENTITY stdout.lit "<literal>stdout</literal>">

<!-- TODO: centralise to mdb -->
<!ENTITY io.arg "<replaceable>io</replaceable>">
<!ENTITY re.arg "<replaceable>re</replaceable>">
<!ENTITY file.arg "<replaceable>file</replaceable>">
<!ENTITY flags.arg "<replaceable>flags</replaceable>">
<!ENTITY dialect.arg "<replaceable>dialect</replaceable>">
<!ENTITY prefix.arg "<replaceable>prefix</replaceable>">
<!ENTITY length.arg "<replaceable>length</replaceable>">
Expand All @@ -33,7 +35,9 @@
<!ENTITY X.opt "<option>-X</option>">
<!ENTITY e.opt "<option>-e</option>&nbsp;&prefix.arg;">
<!ENTITY E.opt "<option>-E</option>&nbsp;&prefix.arg;">
<!ENTITY F.opt "<option>-F</option>&nbsp;&flags.arg;">
<!ENTITY G.opt "<option>-G</option>&nbsp;&length.arg;">
<!ENTITY k.opt "<option>-k</option>&nbsp;&io.arg;">

<!ENTITY a.opt "<option>-a</option>">
<!ENTITY d.opt "<option>-d</option>">
Expand Down Expand Up @@ -97,6 +101,7 @@ query

<arg choice="opt">&a.opt;</arg>
<arg choice="opt">&c.opt;</arg>
<arg choice="opt">&k.opt;</arg>
<arg choice="opt">&w.opt;</arg>
<arg choice="opt">&X.opt;</arg>
<arg choice="opt">&e.opt;</arg>
Expand Down Expand Up @@ -299,6 +304,60 @@ group (for dialects which have them) (rather than a "whole" regexp)
</listitem>
</varlistentry>

<varlistentry>
<term>&F.opt;</term>

<listitem>
<para>Set <literal>RE_*</literal> flags per &re.3;.
Note not all <code>enum re_flags</code> constants are meaningful
to expose to the &cli;.
The default is no flags set.
The available flags are:</para>

<table>
<col align="left"/>
<col align="left"/>
<col align="left"/>

<thead>
<tr>
<th>Flag</th>
<th>Value</th>
<th>Meaning</th>
</tr>
</thead>

<tbody>
<tr>
<td><literal>b</literal> (&b.opt;)</td>
<td><code>RE_ANCHORED</code></td>
<td>Anchor patterns at both start and end,
as if by <code>^</code> and <code>$</code>
(<code>\Z</code> for PCRE).</td>
</tr>
<tr>
<td><literal>i</literal> (&i.opt;)</td>
<td><code>RE_ICASE</code></td>
<td>Patterns are case insensitive.</td>
</tr>
<tr>
<td><literal>s</literal></td>
<td><code>RE_SINGLE</code></td>
<td>Single-line mode.
Equivalent to <code>PCRE_DOTALL</code>.</td>
</tr>
<tr>
<td><literal>x</literal></td>
<td><code>RE_EXTENDED</code></td>
<td>
Eextended mode.
Equivalent to <code>PCRE_EXTENDED</code>.</td>
</tr>
</tbody>
</table>
</listitem>
</varlistentry>

<varlistentry>
<term>&G.opt;</term>

Expand All @@ -307,6 +366,16 @@ group (for dialects which have them) (rather than a "whole" regexp)
</listitem>
</varlistentry>

<varlistentry>
<term>&k.opt;</term>

<listitem>
<para>Set the IO &api; for output,
per the <code>io</code> option for &fsm_print.3;.
The default is <literal>getc</literal>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>&q.opt;</term>

Expand Down

0 comments on commit a925708

Please sign in to comment.