New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to readOption into string array? #1713

Closed
FreeSlave opened this Issue Mar 16, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@FreeSlave

FreeSlave commented Mar 16, 2017

I'm trying to do it that way

string[] arr;
readOption("arr", &arr, "arr");

but it gives me error

../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/data/json.d(626,10): Error: static assert  "JSON can only be cast to (bool, long, std.bigint.BigInt, double, string, Json[] or Json[string]. Not string[]."
../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/core/args.d(66,17):        instantiated from here: to!(string[])
source/app.d(55,15):        instantiated from here: readOption!(string[])

std.getopt is capable of dealing with arrays, so why readOption is not?

@s-ludwig s-ludwig closed this in 4767b91 Mar 23, 2017

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Mar 23, 2017

Member

It was the JSON configuration file support that got in the way. Now that also supports arrays.

Member

s-ludwig commented Mar 23, 2017

It was the JSON configuration file support that got in the way. Now that also supports arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment