Skip to content
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

Replace winix library with Clara #166

Closed
utilForever opened this issue May 5, 2018 · 3 comments
Closed

Replace winix library with Clara #166

utilForever opened this issue May 5, 2018 · 3 comments
Assignees

Comments

@utilForever
Copy link
Collaborator

utilForever commented May 5, 2018

I'll replace the winix library with the Clara. winix library is inconvenient to use, so I want to replace it with a library that supports a more convenient way.

@doyubkim
Copy link
Owner

doyubkim commented May 5, 2018

Thanks! Does Clara provide auto generated help message? How does it compare to https://github.com/hbristow/argparse or other similar libraries?

@utilForever
Copy link
Collaborator Author

Yes. Clara provide auto-generated help message. For example:

inline std::string ToString(const clara::Opt& opt)
{
    std::ostringstream oss;
    oss << (clara::Parser() | opt);
    return oss.str();
}

inline std::string ToString(const clara::Parser& p)
{
    std::ostringstream oss;
    oss << p;
    return oss.str();
}

...

auto parser =
		clara::Help(showHelp) |
		clara::Opt(targetSpacing, "targetSpacing")
		["-s"]["--spacing"]
		("target particle spacing (default is 0.02)");
if (showHelp)
{
	std::cout << ToString(parser) << '\n';
	exit(EXIT_SUCCESS);
}

It has a more concise syntax than other libraries and has the advantage of automatically generating help.

@doyubkim
Copy link
Owner

doyubkim commented May 5, 2018

Cool. Let’s add it as a git submodule.

@doyubkim doyubkim mentioned this issue May 5, 2018
4 tasks
@doyubkim doyubkim added this to the Jet Framework v2 milestone May 6, 2018
@utilForever utilForever changed the title Replace getopt library with Clara Replace winix library with Clara May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants