aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/getopt/small
diff options
context:
space:
mode:
authoralbert <albert@yandex-team.ru>2022-02-10 16:48:14 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:14 +0300
commit9f25ef3232c288ca664ceee6c376cf64e4349a2e (patch)
treeb192eaf3150845f7302fafd460a972b0439d6fe5 /library/cpp/getopt/small
parent6a1e535429145ec1ecfbc5f1efd3c95323261fb5 (diff)
downloadydb-9f25ef3232c288ca664ceee6c376cf64e4349a2e.tar.gz
Restoring authorship annotation for <albert@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt/small')
-rw-r--r--library/cpp/getopt/small/last_getopt.cpp4
-rw-r--r--library/cpp/getopt/small/last_getopt.h6
-rw-r--r--library/cpp/getopt/small/last_getopt_support.h12
-rw-r--r--library/cpp/getopt/small/opt.cpp10
-rw-r--r--library/cpp/getopt/small/opt.h2
-rw-r--r--library/cpp/getopt/small/posix_getopt.cpp4
6 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/getopt/small/last_getopt.cpp b/library/cpp/getopt/small/last_getopt.cpp
index 30669b2c5a..510d089382 100644
--- a/library/cpp/getopt/small/last_getopt.cpp
+++ b/library/cpp/getopt/small/last_getopt.cpp
@@ -1,9 +1,9 @@
#include "last_getopt.h"
-namespace NLastGetopt {
+namespace NLastGetopt {
void PrintUsageAndExit(const TOptsParser* parser) {
parser->PrintUsage();
exit(0);
}
-
+
}
diff --git a/library/cpp/getopt/small/last_getopt.h b/library/cpp/getopt/small/last_getopt.h
index 07687bc914..a338d2cc56 100644
--- a/library/cpp/getopt/small/last_getopt.h
+++ b/library/cpp/getopt/small/last_getopt.h
@@ -22,14 +22,14 @@ namespace NLastGetopt {
public:
using TContainer = Container;
using TValue = typename TContainer::value_type;
-
+
explicit TOptRangeSplitHandler(TContainer* target, const char elementsDelim, const char rangesDelim)
: Target(target)
, ElementsDelim(elementsDelim)
, RangesDelim(rangesDelim)
{
}
-
+
void HandleOpt(const TOptsParser* parser) override {
const TStringBuf curval(parser->CurValOrDef());
if (curval.IsInited()) {
@@ -54,7 +54,7 @@ namespace NLastGetopt {
TContainer* Target;
char ElementsDelim;
char RangesDelim;
- };
+ };
template <class Container>
struct TOptSplitHandler: public IOptHandler {
diff --git a/library/cpp/getopt/small/last_getopt_support.h b/library/cpp/getopt/small/last_getopt_support.h
index 17bed3e614..7d8cdfba55 100644
--- a/library/cpp/getopt/small/last_getopt_support.h
+++ b/library/cpp/getopt/small/last_getopt_support.h
@@ -36,13 +36,13 @@ namespace NLastGetopt {
class THandlerFunctor0
: public IOptHandler {
TpFunc Func_;
-
+
public:
THandlerFunctor0(TpFunc func)
: Func_(func)
{
}
-
+
void HandleOpt(const TOptsParser*) override {
Func_();
}
@@ -54,7 +54,7 @@ namespace NLastGetopt {
TpFunc Func_;
const TpArg Def_;
const bool HasDef_;
-
+
public:
THandlerFunctor1(TpFunc func)
: Func_(func)
@@ -73,7 +73,7 @@ namespace NLastGetopt {
void HandleOpt(const TOptsParser* parser) override;
};
-
+
template <typename TpFunc>
class THandlerFunctor1<TpFunc, const TOptsParser*>
: public IOptHandler {
@@ -84,7 +84,7 @@ namespace NLastGetopt {
: Func_(func)
{
}
-
+
void HandleOpt(const TOptsParser* parser) override {
Func_(parser);
}
@@ -105,7 +105,7 @@ namespace NLastGetopt {
*Target_ = val;
}
};
-
+
template <typename TpTarget, typename TpFunc, typename TpVal = TpTarget>
class TStoreMappedResultFunctor {
private:
diff --git a/library/cpp/getopt/small/opt.cpp b/library/cpp/getopt/small/opt.cpp
index 744501765c..356439eb38 100644
--- a/library/cpp/getopt/small/opt.cpp
+++ b/library/cpp/getopt/small/opt.cpp
@@ -27,13 +27,13 @@ void Opt::Init(int argc, char* argv[], const char* optString, const Ion* longOpt
TOpt* opt;
if ((unsigned)o->val < 0x80 && isalnum(o->val)) {
opt = &Opts_->CharOption(char(o->val));
- opt->AddLongName(o->name);
+ opt->AddLongName(o->name);
} else {
Opts_->AddLongOption(o->name);
opt = const_cast<TOpt*>(&Opts_->GetLongOption(o->name));
}
opt->HasArg_ = EHasArg(o->has_arg);
- opt->UserValue(o);
+ opt->UserValue(o);
}
Opts_->AllowSingleDashForLong_ = longOnly;
Opts_->AllowPlusForLong_ = true;
@@ -68,7 +68,7 @@ int Opt::Get(int* longOptionIndex) {
return EOF;
} else {
Arg = (char*)OptsParser_->CurVal();
- if (!OptsParser_->CurOpt()) {
+ if (!OptsParser_->CurOpt()) {
// possible if RETURN_IN_ORDER
return 1;
} else {
@@ -76,7 +76,7 @@ int Opt::Get(int* longOptionIndex) {
if (longOptionIndex) {
*longOptionIndex = int(ion - Ions_);
}
- char c = OptsParser_->CurOpt()->GetCharOr0();
+ char c = OptsParser_->CurOpt()->GetCharOr0();
return c != 0 ? c : ion->val;
}
}
@@ -89,7 +89,7 @@ int Opt::Get(int* longOptionIndex) {
}
void Opt::DummyHelp(IOutputStream& os) {
- Opts_->PrintUsage(GetProgramName(), os);
+ Opts_->PrintUsage(GetProgramName(), os);
}
int Opt::GetArgC() const {
diff --git a/library/cpp/getopt/small/opt.h b/library/cpp/getopt/small/opt.h
index ecb57439bc..404965c0d7 100644
--- a/library/cpp/getopt/small/opt.h
+++ b/library/cpp/getopt/small/opt.h
@@ -129,7 +129,7 @@ int opt_get_number(int& argc, char* argv[]);
} \
break;
-#define OPTION_HANDLE(opt, handle) \
+#define OPTION_HANDLE(opt, handle) \
OPTION_HANDLE_BEGIN(opt) \
handle; \
OPTION_HANDLE_END
diff --git a/library/cpp/getopt/small/posix_getopt.cpp b/library/cpp/getopt/small/posix_getopt.cpp
index bd06f3499f..bbe89080a5 100644
--- a/library/cpp/getopt/small/posix_getopt.cpp
+++ b/library/cpp/getopt/small/posix_getopt.cpp
@@ -29,13 +29,13 @@ namespace NLastGetopt {
TOpt* opt;
if ((unsigned)o->val < 0x80 && isalnum(o->val)) {
opt = &Opts->CharOption(char(o->val));
- opt->AddLongName(o->name);
+ opt->AddLongName(o->name);
} else {
Opts->AddLongOption(o->name);
opt = const_cast<TOpt*>(&Opts->GetLongOption(o->name));
}
opt->HasArg_ = EHasArg(o->has_arg);
- opt->UserValue(o->flag);
+ opt->UserValue(o->flag);
}
OptsParser.Reset(new TOptsParser(&*Opts, argc, (const char**)argv));