Git Product home page Git Product logo

quick_arg_parser's People

Contributors

dugy avatar gchoinka avatar mtnviewjohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

quick_arg_parser's Issues

std::vector specialization does not support multiple option instances

test2.cpp.zip

This is a slightly modified version of your short example. The efficiency option is now a std::vector

Here is some output:
% ./a.out -v -e 5
Folder .
Efficiency 5

% ./a.out -v -e 5,6
Folder .
Efficiency 5
Efficiency 6

So far, so good. But what about this?
% ./a.out -v -e 5 -e 6
Folder .
Efficiency 5

This is unfortunate. I think that options that specialize std::vector should allowed to work whether they arguments are in one list or several.

Not Posix compliant, nor Gnu getopt_long compliant

Here is some test code derived from your short example:
test.cpp.zip

Here is its output:
% ./a.out . --efficiency 9 -v
Folder .
Efficiency 9

% ./a.out . -e 9 -v
Folder .
Efficiency 9

These should also work according to the Posix getopt() spec, but they don't.
% ./a.out . -e9 -v
Switch group -e9 contains a switch that needs an argument

% ./a.out . -ve 9
Switch group -ve contains a switch that needs an argument

% ./a.out . -ve9
Switch group -ve9 contains a switch that needs an argument

This should work, but it doesn't:
% ./a.out . --efficiency=9 -v
Unknown switch --efficiency=9

Bug when compiling with MSVC

Godbolt: https://godbolt.org/z/74v6n3

example.cpp
<source>(9): error C2668: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string': ambiguous call to overloaded function
C:/data/msvc/14.28.29333/include\xstring(2496): note: could be 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::basic_string<char,std::char_traits<char>,std::allocator<char>> &&) noexcept'
C:/data/msvc/14.28.29333/include\xstring(2413): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const )'
        with
        [
            _Elem=char
        ]
C:/data/msvc/14.28.29333/include\xstring(2754): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::initializer_list<_Elem>,const _Alloc &)'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
<source>(9): note: while trying to match the argument list '(MainArguments<Input>::Grabber<MainArguments<Input>::DummyValidator>)'
Compiler returned: 2

The weird thing is that everything works fine with GCC and Clang.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.