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

Option value can't start with a dash #50

Open
aivarsk opened this issue Jan 8, 2018 · 1 comment
Open

Option value can't start with a dash #50

aivarsk opened this issue Jan 8, 2018 · 1 comment

Comments

@aivarsk
Copy link

aivarsk commented Jan 8, 2018

This test case fails:

TEST_CASE( "Opt value can start with a dash" ) {
    std::string name;
    bool showHelp = false;
    auto parser
            = Help( showHelp )
            | Opt( name, "name" )
                ["-n"]["--name"]
                ( "the name to use" );

    auto result = parser.parse( Args{ "TestApp", "-n", "-lfoobar" } );
    CHECK( result );
    REQUIRE( name == "-lfoobar" );
}

I have a program that receives compiler flags in arguments so a leading dash is common.

@mike239x
Copy link

Also related to this issue:
if I have an option that takes an integer, it can no longer be negative, since Clara can't parse things that start this a minus.

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

No branches or pull requests

2 participants