clipp icon indicating copy to clipboard operation
clipp copied to clipboard

Strange behavior with one_of

Open mohd-akram opened this issue 5 years ago • 2 comments

I have this code:

#include <iostream>

#include "clipp.h"

int main(int argc, char *argv[])
{
	std::string foo, bar, baz;

	auto a = (
		clipp::value("bar", bar)
	);

	auto b = (
		clipp::value("foo", foo),
		clipp::value("bar", bar)
	);

	auto cli = (a | b);

	if (!clipp::parse(argc, argv, cli)) {
		std::cerr << clipp::usage_lines(cli, argv[0]) << std::endl;
		return EXIT_FAILURE;
	}
}

Running c++ -std=c++17 main.cpp && ./a.out foo bar shows me the usage lines even though it's compatible.

mohd-akram avatar Sep 15 '18 17:09 mohd-akram

Yeah that seems to be a bug. I also think that I already know where it goes wrong.

muellan avatar Sep 17 '18 07:09 muellan

Have you been able to fix this yet @muellan ? What keeps resulting in this error?

jmdaemon avatar Aug 19 '21 05:08 jmdaemon