getopt: How does arraySep work?
zorael at gmail.com
Tue Jul 14 13:51:58 UTC 2020
On Tuesday, 14 July 2020 at 11:12:06 UTC, Andre Pany wrote:
Steven Schveighoffer already answered while I was composing this,
so discarding top half.
As far as I can tell the default arraySep of "" splitting the
argument by whitespace is simply not the case.
else static if (isArray!(typeof(*receiver)))
// array receiver
import std.range : ElementEncodingType;
alias E = ElementEncodingType!(typeof(*receiver));
if (arraySep == "")
*receiver ~= to!E(val);
foreach (elem; val.splitter(arraySep).map!(a =>
*receiver ~= elem;
So you will probably want an arraySep of " " if you want
--modelicalibs "a b".
More information about the Digitalmars-d-learn