Coder Social home page Coder Social logo

badaix / popl Goto Github PK

View Code? Open in Web Editor NEW
155.0 155.0 31.0 262 KB

Header-only C++ program options parser library

License: MIT License

Makefile 0.09% C++ 99.65% CMake 0.26%
argument-parser bash-completion command-line-parser commandline-flags cpp11 getopt groff header-only option-parser program-options

popl's People

Contributors

badaix avatar metthal avatar pavelkryukov 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  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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

popl's Issues

Multiple definitions of helpers

Hi

The latest version produces strange failures on linkage: https://travis-ci.org/MIPT-ILab/mipt-mips/jobs/383377807. IIUC, for methods of Option class inline qualifier protects from those error , but it looks like it does not help for ...HelpPrinter classes.

I suspect the problem is these functions are virtual, but not pure-virtual in the base class. It is impossible to inline a virtual function by definition, so compiler leaves them as is, making their symbols accessible outside. Note that since templates instances are not intended to have an external linkage by default, there are no problems with classes derived from Option.

long arguments fail on Fedora 23/34

$ ./popl --string "foo" --float 1.4
NonOptionArg: foo
NonOptionArg: 1.4
UnknownOptions: --string
UnknownOptions: foo
floatOption  - isSet: 0, value: 1.23, reference: 1.23
doubleOption - isSet: 0, value: 3.14159
terminate called after throwing an instance of 'std::out_of_range'
  what():  option not set: "-s"
Aborted (Speicherabzug geschrieben)
$ ./popl --string="foo" --float=1.4
UnknownOptions: --string=foo
UnknownOptions: --float=1.4
floatOption  - isSet: 0, value: 1.23, reference: 1.23
doubleOption - isSet: 0, value: 3.14159
terminate called after throwing an instance of 'std::out_of_range'
  what():  option not set: "-s"
Aborted (Speicherabzug geschrieben)

Implicit argument ignored when specified as standalone parameter

There seems to be a parsing difference between --foo bar and --foo=bar if argument is declared implicit. The former is parsed as "Use --foo but with the default value" followed by a positional argument with value bar whereas the later is parsed as expected.

Compilation fails with older CMake

Hi,

CMAKE_CXX_STANDARD does not work with older cmake versions (not sure which one, but 2.4 does not support it); therefore, it builds with C++ < 11 and fails (e.g. "nullptr").

If version is less than 3.1, CXX flags should be set explicitly:

if (CMAKE_VERSION VERSION_LESS "3.1")
    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
      set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
    endif ()
  else ()
    set (CMAKE_CXX_STANDARD 11)
  endif ()

Regards
Eugenio

default value isnt working

Hi,
I just tried the default value argument and it doesnt work.

image

image

How do I assign default value to the variable itself ?

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.