Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Fix overloads of Arg::parse() #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

aghast
Copy link

@aghast aghast commented Jan 17, 2018

…to match Opt::parse(). Add test case parsing single Arg, no Opt.

I tried creating "simple" parser using Arg instead of Opt, based on the tutorial:

	int jumpto = 0;
	auto jarg = Arg(jumpto, "jump to");
	jarg.parse(Args{"exename", "10"});

This failed, because Arg is not using ParserBase::parse the way Opt does. So I added a test case, and the using statement required to resolve it.

/Users/austin/Code/clara/src/ClaraTests.cpp:83:43: error: too few arguments to function
      call, expected 2, have 1
        p.parse( Args{ "TestApp", "foo" } );
        ~~~~~~~                           ^
/Users/austin/Code/clara/include/clara.hpp:582:9: note: 'parse' declared here
        auto parse( std::string const &, TokenStream const &tokens ) const -> Int...
        ^
1 error generated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant