Commit Graph

37 Commits

Author SHA1 Message Date
Akos Kiss 9a454c8e4e
Improve help of short-only options (remove dangling comma) (#235) 2020-06-04 13:21:51 +10:00
Jarryd Beck 6fa46a7488 Don't return parse result
Fixes #219. The example was wrong as ParseResult can't be returned out
of scope of the options parser.
2020-01-17 08:03:57 +11:00
Jarryd Beck 4a0af0e950 Fix parsing char type
Fixes #201. Parse char type correctly and check for length.
2019-08-23 08:26:16 +10:00
Christian Lang 7b14d5f60b Fix parsing of std::vector and add test, example and documentation (#182)
Improve parsing into std::vector so that a single argument can take a list.
2019-06-18 08:14:18 +10:00
Jarryd Beck c713b44d92 Use a shared pointer for the options map
Fixes #132. Since the map of options is shared between Options and
ParseResult, they should use a shared pointer instead of a reference so
that ParseResult can be returned without referencing destroyed memory.
2018-11-08 18:22:42 +11:00
Frank Schoenmann ca6e9f70eb Allow unrecognised options. (#105)
Allows unrecognised options to be left alone by the parser without throwing an exception.
2018-04-12 08:15:07 +10:00
Jarryd Beck cc4914f065 Revert "Added const to argv type for better interoperability. (#99)"
This reverts commit 0f819a5cab.
2018-04-10 08:48:08 +10:00
Jesús González 0f819a5cab Added const to argv type for better interoperability. (#99)
* Added const to argv type for better interoperability.
2018-03-09 08:07:29 +11:00
Jarryd Beck e40645e084 Don't show default when boolean false
Fixes #102. Don't show the default value when it is a boolean and the
value is false. Note that this is a bit of a hack and the
implementation should probably be reevaluated in the future.
2018-03-08 08:53:26 +11:00
Jarryd Beck 24450d183a Allow positional arguments to show in help
Fixes #72. This adds an option for positional arguments to be
shown in the help output.
2017-11-13 18:47:12 +11:00
Jarryd Beck 8010e06952 Move parse result to an immutable object
This is far from ideal, but it's the first step in moving the parse
result to an immutable object so that the parser can be reused.
2017-10-18 18:37:58 +11:00
Hannah Rittich 2aed1ce41b Added parsing of general types. (#63)
Adds generic parsing of types using `operator>>`, in particular allows
parsing of floats and doubles.
2017-08-16 17:55:06 +10:00
Shivakar Vulli f931fd4279 Allow spaces in option specification. (#58)
Fixes #57.

Allows spaces after the comma between the short and long option
specification.
2017-07-16 15:11:03 +10:00
Jarryd Beck 3c3d2003ca add help for positional parameters 2017-04-26 18:16:00 +10:00
Jarryd Beck 81f1f440ed count arguments 2016-01-22 17:44:00 +11:00
Jarryd Beck b2e7efe7f4 positional arguments parse into multiple options 2015-09-25 16:49:06 +10:00
Baptiste Wicht e09bb9052a Enhance example 2014-10-29 16:59:57 +01:00
Baptiste Wicht 9a2749f692 Merge branch 'master' into default_values
Conflicts:
	src/cxxopts.hpp
	src/example.cpp
2014-10-29 16:42:59 +01:00
Jarryd Beck 1a558d76bd custom argument help 2014-10-29 12:35:05 +11:00
Baptiste Wicht 387e51dc16 Merge branch 'master' into default_values
Conflicts:
	src/cxxopts.hpp
2014-10-27 19:09:41 +01:00
Jarryd Beck 8d7c4ea43e unicode configuration 2014-10-27 22:06:24 +11:00
Jarryd Beck 8234766bca better help example 2014-10-27 16:47:21 +11:00
Jarryd Beck 3707c91a01 unicode help 2014-10-27 16:46:16 +11:00
Jarryd Beck 9d1a4dfcdc more icu::UnicodeString 2014-10-27 15:20:12 +11:00
Baptiste Wicht 456ea951ab Add support for implicit values 2014-10-26 22:05:24 +01:00
Baptiste Wicht b343ad9855 Make the model more powerful 2014-10-26 21:31:16 +01:00
Baptiste Wicht 22ab9836d4 Add basic support for default options 2014-10-26 21:01:18 +01:00
Jarryd Beck 3f1220e3d8 help string 2014-10-17 11:59:40 +11:00
Jarryd Beck 1d9ae57a92 parse groups 2014-10-14 16:59:54 +11:00
Jarryd Beck 239525bcf4 parse into value 2014-10-14 16:59:25 +11:00
Jarryd Beck c8b22d113d print usage 2014-10-14 13:29:30 +11:00
Jarryd Beck fd3d4bb2e7 test long option names 2014-10-14 10:39:03 +11:00
Jarryd Beck 18ad3b1659 exception on parse error 2014-10-13 20:52:06 +11:00
Jarryd Beck abf96da697 fix description formatting 2014-10-13 15:58:17 +11:00
Jarryd Beck 2e4c78805d format help description 2014-10-13 14:30:56 +11:00
Jarryd Beck 4f8ded2a39 update message 2014-10-13 09:20:04 +11:00
Jarryd Beck def4848b23 move to example.cpp 2014-10-10 18:03:44 +11:00