Merge branch 'untangle-includes'
This commit is contained in:
commit
34a12a5232
@ -24,6 +24,8 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
#include "cxxopts.hpp"
|
#include "cxxopts.hpp"
|
||||||
|
|
||||||
|
#include <regex>
|
||||||
|
|
||||||
#define OPTION_LONGEST 30
|
#define OPTION_LONGEST 30
|
||||||
#define OPTION_DESC_GAP 2
|
#define OPTION_DESC_GAP 2
|
||||||
|
|
||||||
@ -136,8 +138,8 @@ Options::add_options(std::string group)
|
|||||||
|
|
||||||
OptionAdder&
|
OptionAdder&
|
||||||
OptionAdder::operator()
|
OptionAdder::operator()
|
||||||
(
|
(
|
||||||
const std::string& opts,
|
const std::string& opts,
|
||||||
const std::string& desc,
|
const std::string& desc,
|
||||||
std::shared_ptr<const Value> value
|
std::shared_ptr<const Value> value
|
||||||
)
|
)
|
||||||
@ -162,7 +164,7 @@ void
|
|||||||
Options::parse_option
|
Options::parse_option
|
||||||
(
|
(
|
||||||
std::shared_ptr<OptionDetails> value,
|
std::shared_ptr<OptionDetails> value,
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& arg
|
const std::string& arg
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -291,7 +293,7 @@ Options::parse(int& argc, char**& argv)
|
|||||||
else if (result[1].length() != 0)
|
else if (result[1].length() != 0)
|
||||||
{
|
{
|
||||||
std::string name = result[1];
|
std::string name = result[1];
|
||||||
|
|
||||||
auto iter = m_options.find(name);
|
auto iter = m_options.find(name);
|
||||||
|
|
||||||
if (iter == m_options.end())
|
if (iter == m_options.end())
|
||||||
@ -343,8 +345,8 @@ void
|
|||||||
Options::add_option
|
Options::add_option
|
||||||
(
|
(
|
||||||
const std::string& group,
|
const std::string& group,
|
||||||
const std::string& s,
|
const std::string& s,
|
||||||
const std::string& l,
|
const std::string& l,
|
||||||
const std::string& desc,
|
const std::string& desc,
|
||||||
std::shared_ptr<const Value> value
|
std::shared_ptr<const Value> value
|
||||||
)
|
)
|
||||||
@ -397,7 +399,7 @@ Options::help_one_group(const std::string& g) const
|
|||||||
size_t longest = 0;
|
size_t longest = 0;
|
||||||
|
|
||||||
std::string result;
|
std::string result;
|
||||||
|
|
||||||
if (!g.empty())
|
if (!g.empty())
|
||||||
{
|
{
|
||||||
result += " " + g + " options:\n\n";
|
result += " " + g + " options:\n\n";
|
||||||
@ -443,7 +445,7 @@ Options::help_one_group(const std::string& g) const
|
|||||||
std::string
|
std::string
|
||||||
Options::help(const std::vector<std::string>& groups) const
|
Options::help(const std::vector<std::string>& groups) const
|
||||||
{
|
{
|
||||||
std::string result = "Usage:\n " + m_program + " [OPTION...] "
|
std::string result = "Usage:\n " + m_program + " [OPTION...] "
|
||||||
+ m_help_string + "\n\n";
|
+ m_help_string + "\n\n";
|
||||||
|
|
||||||
for (const auto& g : groups)
|
for (const auto& g : groups)
|
||||||
|
@ -25,13 +25,13 @@ THE SOFTWARE.
|
|||||||
#ifndef CXX_OPTS_HPP
|
#ifndef CXX_OPTS_HPP
|
||||||
#define CXX_OPTS_HPP
|
#define CXX_OPTS_HPP
|
||||||
|
|
||||||
#include <regex>
|
|
||||||
#include <set>
|
|
||||||
#include <map>
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace cxxopts
|
namespace cxxopts
|
||||||
{
|
{
|
||||||
@ -133,7 +133,7 @@ namespace cxxopts
|
|||||||
public:
|
public:
|
||||||
option_not_has_argument_exception
|
option_not_has_argument_exception
|
||||||
(
|
(
|
||||||
const std::string& option,
|
const std::string& option,
|
||||||
const std::string& arg
|
const std::string& arg
|
||||||
)
|
)
|
||||||
: OptionParseException(
|
: OptionParseException(
|
||||||
@ -291,7 +291,7 @@ namespace cxxopts
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string&
|
const std::string&
|
||||||
description() const
|
description() const
|
||||||
{
|
{
|
||||||
return m_desc;
|
return m_desc;
|
||||||
@ -364,8 +364,8 @@ namespace cxxopts
|
|||||||
add_option
|
add_option
|
||||||
(
|
(
|
||||||
const std::string& group,
|
const std::string& group,
|
||||||
const std::string& s,
|
const std::string& s,
|
||||||
const std::string& l,
|
const std::string& l,
|
||||||
const std::string& desc,
|
const std::string& desc,
|
||||||
std::shared_ptr<const Value> value
|
std::shared_ptr<const Value> value
|
||||||
);
|
);
|
||||||
@ -403,7 +403,7 @@ namespace cxxopts
|
|||||||
help(const std::vector<std::string>& groups = {""}) const;
|
help(const std::vector<std::string>& groups = {""}) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void
|
void
|
||||||
add_one_option
|
add_one_option
|
||||||
(
|
(
|
||||||
@ -421,10 +421,10 @@ namespace cxxopts
|
|||||||
parse_option
|
parse_option
|
||||||
(
|
(
|
||||||
std::shared_ptr<OptionDetails> value,
|
std::shared_ptr<OptionDetails> value,
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& arg = ""
|
const std::string& arg = ""
|
||||||
);
|
);
|
||||||
|
|
||||||
void
|
void
|
||||||
checked_parse_arg
|
checked_parse_arg
|
||||||
(
|
(
|
||||||
@ -459,8 +459,8 @@ namespace cxxopts
|
|||||||
|
|
||||||
OptionAdder&
|
OptionAdder&
|
||||||
operator()
|
operator()
|
||||||
(
|
(
|
||||||
const std::string& opts,
|
const std::string& opts,
|
||||||
const std::string& desc,
|
const std::string& desc,
|
||||||
std::shared_ptr<const Value> value
|
std::shared_ptr<const Value> value
|
||||||
= ::cxxopts::value<bool>()
|
= ::cxxopts::value<bool>()
|
||||||
|
Loading…
Reference in New Issue
Block a user