argparse documentation Help

End of named arguments

When the command line contains an entry that is equal to Config.endOfNamedArgs (double dash -- by default), argparse interprets all following command line entries as positional arguments, even if they can match a named argument or a subcommand.

import argparse; struct T { @NamedArgument string a; @NamedArgument string b; @PositionalArgument(0) string[] args; } T t; assert(CLI!T.parseArgs(t, ["-a","A","--","-b","B"])); assert(t == T("A","",["-b","B"]));
Last modified: 09 November 2024