New library: argparse, for parsing CLI arguments

Andrey Zherikov andrey.zherikov at gmail.com
Thu Oct 14 13:37:29 UTC 2021


On Thursday, 14 October 2021 at 02:09:35 UTC, Bill Baxter wrote:
> Yeh, it's definitely a mixed bag.  It can be very convenient to 
> be able to put the flag right near point of use without having 
> to do any plumbing. But sometimes it can be frustrating given 
> that "flags" are essentially a single global namespace that 
> people don't always realize is a global namespace.  Quite 
> annoying when you go to add something like a "--start_time" 
> flag and find that some random .cc file in a library already 
> defines that flag for their own purposes.
>
> --bb

I might be wrong but AFAIK D program doesn't have global 
namespace - it's split between modules.

Another thing is that I couldn't use `allMembers` without using 
the module name explicitly, because: `__traits(isModule, 
__MODULE__)` returns `false` and `__traits(allMembers, 
__MODULE__)` gives `"mymodule" can't have members,  "mymodule" 
must evaluate to either a module, a struct, an union, a class, an 
interface or a template instantiation`


More information about the Digitalmars-d-announce mailing list