Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/herd.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,11 @@ \subsection{\label{herd:configfile}{Configuration files}}
as setting the value of parameter~\textit{key} to \textit{arg}.
Each parameter has a corresponding option,
usually \opt{-}\textit{key}, except for the single letter
option \opt{-v} whose parameter is \opt{verbose}.
options \opt{-v} whose parameter is \opt{verbose} and
\opt{-I} whose parameter is \opt{include}. Additionally,
the special syntax \opt{include $dirname} is recognised
when being a prefix of the argument of the parameter~\opt{include}.
This prefix stands for the directory name of the configuration file.

As command line option are processed left-to-right,
settings from a configuration file (option \opt{-conf})
Expand Down
8 changes: 7 additions & 1 deletion herd/lexConf_herd.mll
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ let handle_key dir main key arg = match key with
| "verbose" -> lex_int verbose arg
| "suffix" -> suffix := arg
| "include" ->
includes := !includes @ [arg]
let arg =
let pat = "$dirname" in
if String.starts_with ~prefix:pat arg then
let lpat = String.length pat in
dir ^ String.sub arg lpat (String.length arg - lpat)
else arg in
includes := !includes @ [arg]
| "timeout" ->
lex_float_opt timeout arg
| "debug" ->
Expand Down
Loading