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

Programs with only one final argument not supported. ArgumentParser error: attempt to pass too many inputs to #18

Open
anti-destiny opened this issue Jun 22, 2021 · 0 comments

Comments

@anti-destiny
Copy link

In my case, my program has only one final argument like this:

	// Parse arugments
	ArgumentParser parser; 
	parser.addFinalArgument("work_dir", 1, true);
	parser.parse(argc, argv); 
	auto work_dir = parser.retrieve<string>("work_dir");
	printf("workdir: %s\n", work_dir.c_str());
	exit(0);

However, when I input the following commands, the program throws an error.

$ ./MyProgram ./one_directory
ArgumentParser error: attempt to pass too many inputs to 
Usage: ./MyProgram WORK_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant