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