aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/getopt/small
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:23 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:23 +0300
commit706b83ed7de5a473436620367af31fc0ceecde07 (patch)
tree103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/getopt/small
parent918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff)
downloadydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt/small')
-rw-r--r--library/cpp/getopt/small/last_getopt_opt.h2
-rw-r--r--library/cpp/getopt/small/last_getopt_opts.cpp4
-rw-r--r--library/cpp/getopt/small/last_getopt_parser.cpp2
-rw-r--r--library/cpp/getopt/small/last_getopt_support.h2
-rw-r--r--library/cpp/getopt/small/modchooser.cpp8
-rw-r--r--library/cpp/getopt/small/modchooser.h20
-rw-r--r--library/cpp/getopt/small/opt.h2
-rw-r--r--library/cpp/getopt/small/opt2.cpp4
-rw-r--r--library/cpp/getopt/small/opt2.h16
-rw-r--r--library/cpp/getopt/small/ygetopt.cpp12
10 files changed, 36 insertions, 36 deletions
diff --git a/library/cpp/getopt/small/last_getopt_opt.h b/library/cpp/getopt/small/last_getopt_opt.h
index a8dd5adca9..fe6c2c064d 100644
--- a/library/cpp/getopt/small/last_getopt_opt.h
+++ b/library/cpp/getopt/small/last_getopt_opt.h
@@ -5,7 +5,7 @@
#include <util/string/split.h>
#include <util/generic/ptr.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <util/generic/maybe.h>
#include <util/generic/vector.h>
#include <util/string/cast.h>
diff --git a/library/cpp/getopt/small/last_getopt_opts.cpp b/library/cpp/getopt/small/last_getopt_opts.cpp
index 03c432849f..13c327af12 100644
--- a/library/cpp/getopt/small/last_getopt_opts.cpp
+++ b/library/cpp/getopt/small/last_getopt_opts.cpp
@@ -11,8 +11,8 @@
#include <stdlib.h>
namespace NLastGetoptPrivate {
- TString& VersionString() {
- static TString data;
+ TString& VersionString() {
+ static TString data;
return data;
}
TString& ShortVersionString() {
diff --git a/library/cpp/getopt/small/last_getopt_parser.cpp b/library/cpp/getopt/small/last_getopt_parser.cpp
index 7668b12a03..cf04841fd4 100644
--- a/library/cpp/getopt/small/last_getopt_parser.cpp
+++ b/library/cpp/getopt/small/last_getopt_parser.cpp
@@ -124,7 +124,7 @@ namespace NLastGetopt {
if (opt->GetHasArg() == NO_ARGUMENT) {
return Commit(opt, nullptr, pos, p);
}
- return Commit(opt, arg.SubStr(p), pos + 1, 0);
+ return Commit(opt, arg.SubStr(p), pos + 1, 0);
}
bool TOptsParser::ParseShortOptArg(size_t pos) {
diff --git a/library/cpp/getopt/small/last_getopt_support.h b/library/cpp/getopt/small/last_getopt_support.h
index 17bed3e614..72474578c5 100644
--- a/library/cpp/getopt/small/last_getopt_support.h
+++ b/library/cpp/getopt/small/last_getopt_support.h
@@ -1,7 +1,7 @@
#pragma once
#include <util/string/cast.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <util/generic/vector.h>
#include <util/generic/utility.h>
#include <util/generic/yexception.h>
diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp
index 2fa5cfd070..f6e091fb2d 100644
--- a/library/cpp/getopt/small/modchooser.cpp
+++ b/library/cpp/getopt/small/modchooser.cpp
@@ -128,11 +128,11 @@ void TModChooser::AddAlias(const TString& alias, const TString& mode) {
Modes[alias] = Modes[mode];
}
-void TModChooser::SetDescription(const TString& descr) {
+void TModChooser::SetDescription(const TString& descr) {
Description = descr;
}
-void TModChooser::SetModesHelpOption(const TString& helpOption) {
+void TModChooser::SetModesHelpOption(const TString& helpOption) {
ModesHelpOption = helpOption;
}
@@ -144,7 +144,7 @@ void TModChooser::SetSeparatedMode(bool separated) {
ShowSeparated = separated;
}
-void TModChooser::SetSeparationString(const TString& str) {
+void TModChooser::SetSeparationString(const TString& str) {
SeparationString = str;
}
@@ -277,7 +277,7 @@ TString TModChooser::TMode::FormatFullName(size_t pad) const {
return name;
}
-void TModChooser::PrintHelp(const TString& progName) const {
+void TModChooser::PrintHelp(const TString& progName) const {
Cerr << Description << Endl << Endl;
Cerr << NColorizer::StdErr().BoldColor() << "Usage" << NColorizer::StdErr().OldColor() << ": " << progName << " MODE [MODE_OPTIONS]" << Endl;
Cerr << Endl;
diff --git a/library/cpp/getopt/small/modchooser.h b/library/cpp/getopt/small/modchooser.h
index 0a8de6d50b..656e007489 100644
--- a/library/cpp/getopt/small/modchooser.h
+++ b/library/cpp/getopt/small/modchooser.h
@@ -3,7 +3,7 @@
#include "last_getopt_opts.h"
#include <util/generic/map.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <util/generic/vector.h>
#include <functional>
@@ -63,10 +63,10 @@ public:
void AddAlias(const TString& alias, const TString& mode);
//! Set main program description.
- void SetDescription(const TString& descr);
+ void SetDescription(const TString& descr);
//! Set modes help option name (-? is by default)
- void SetModesHelpOption(const TString& helpOption);
+ void SetModesHelpOption(const TString& helpOption);
//! Specify handler for '--version' parameter
void SetVersionHandler(TVersionHandlerPtr handler);
@@ -75,7 +75,7 @@ public:
void SetSeparatedMode(bool separated = true);
//! Set separation string
- void SetSeparationString(const TString& str);
+ void SetSeparationString(const TString& str);
//! Set short command representation in Usage block
void SetPrintShortCommandInUsage(bool printShortCommandInUsage);
@@ -100,12 +100,12 @@ public:
//! Run appropriate mode. Same as Run(const int, const char**)
int Run(const TVector<TString>& argv) const;
- void PrintHelp(const TString& progName) const;
+ void PrintHelp(const TString& progName) const;
struct TMode {
- TString Name;
+ TString Name;
TMainClass* Main;
- TString Description;
+ TString Description;
bool Hidden;
bool NoCompletion;
TVector<TString> Aliases;
@@ -136,10 +136,10 @@ public:
private:
//! Main program description.
- TString Description;
+ TString Description;
//! Help option for modes.
- TString ModesHelpOption;
+ TString ModesHelpOption;
//! Wrappers around all modes.
TVector<THolder<TMainClass>> Wrappers;
@@ -162,7 +162,7 @@ private:
bool PrintShortCommandInUsage;
//! Text string used when displaying each separator
- TString SeparationString;
+ TString SeparationString;
//! Unsorted list of options
TVector<THolder<TMode>> UnsortedModes;
diff --git a/library/cpp/getopt/small/opt.h b/library/cpp/getopt/small/opt.h
index ecb57439bc..b18f06d6e0 100644
--- a/library/cpp/getopt/small/opt.h
+++ b/library/cpp/getopt/small/opt.h
@@ -93,7 +93,7 @@ public:
return Arg;
}
- TVector<TString> GetFreeArgs() const {
+ TVector<TString> GetFreeArgs() const {
return NLastGetopt::TOptsParseResult(&*Opts_, GetArgC(), GetArgV()).GetFreeArgs();
}
diff --git a/library/cpp/getopt/small/opt2.cpp b/library/cpp/getopt/small/opt2.cpp
index 0cdc774e78..2816aef7a5 100644
--- a/library/cpp/getopt/small/opt2.cpp
+++ b/library/cpp/getopt/small/opt2.cpp
@@ -57,7 +57,7 @@ void Opt2::EatArgv(const char* optspec, const char* long_alias) {
// long_alias has a form "long-name1=A,long-name2=B", etc.
// This implementation is limited to aliasing a single long option
// with single short option (extend it if you really need).
- THashMap<const char*, char> long2short;
+ THashMap<const char*, char> long2short;
long2short["help"] = '?';
long_alias = long_alias ? long_alias : "";
alias_copy = long_alias;
@@ -105,7 +105,7 @@ void Opt2::EatArgv(const char* optspec, const char* long_alias) {
}
// long option always spans one argv (--switch or --option-name=value)
const char* eq = strchr(s, '=');
- TString lname(s, eq ? (size_t)(eq - s) : (size_t)strlen(s));
+ TString lname(s, eq ? (size_t)(eq - s) : (size_t)strlen(s));
THashMap<const char*, char>::iterator i = long2short.find(lname.data());
if (i == long2short.end()) {
UnknownLongOption = strdup(lname.data()); // free'd in AutoUsage()
diff --git a/library/cpp/getopt/small/opt2.h b/library/cpp/getopt/small/opt2.h
index 4d9d943237..70b2701122 100644
--- a/library/cpp/getopt/small/opt2.h
+++ b/library/cpp/getopt/small/opt2.h
@@ -1,7 +1,7 @@
#pragma once
#include <util/system/defaults.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <util/generic/vector.h>
// simplified options parser
@@ -31,9 +31,9 @@ struct Opt2Param {
bool IsRequired;
bool MultipleUse;
const char* DefValue;
- TString DefValueStr;
- TString HelpUsage;
- TVector<const char*> ActualValue;
+ TString DefValueStr;
+ TString HelpUsage;
+ TVector<const char*> ActualValue;
const char* LongOptName;
Opt2Param()
: HasArg(false)
@@ -112,7 +112,7 @@ public:
public:
// non-option args
- TVector<char*> Pos;
+ TVector<char*> Pos;
bool HasErrors;
private:
@@ -122,15 +122,15 @@ private:
char OptionMissingArg;
char OptionWrongArg;
char RequiredOptionMissing;
- TVector<TString> UserErrorMessages;
+ TVector<TString> UserErrorMessages;
protected:
int Argc;
char* const* Argv;
int MinArgs, MaxArgs;
ui8 SpecsMap[256];
- TVector<Opt2Param> Specs;
- TString alias_copy;
+ TVector<Opt2Param> Specs;
+ TString alias_copy;
void EatArgv(const char* optspec, const char* long_alias);
void Clear();
Opt2Param& GetInternal(char opt, const char* defValue, const char* helpUsage, bool required);
diff --git a/library/cpp/getopt/small/ygetopt.cpp b/library/cpp/getopt/small/ygetopt.cpp
index 1f52827f74..f11e39588e 100644
--- a/library/cpp/getopt/small/ygetopt.cpp
+++ b/library/cpp/getopt/small/ygetopt.cpp
@@ -1,7 +1,7 @@
#include "opt.h"
#include "ygetopt.h"
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <util/generic/vector.h>
#include <util/generic/yexception.h>
@@ -67,7 +67,7 @@ private:
const char* Arg_;
};
-TGetOpt::TIterator::TIterator() noexcept
+TGetOpt::TIterator::TIterator() noexcept
: Impl_(nullptr)
{
}
@@ -82,11 +82,11 @@ void TGetOpt::TIterator::Next() {
Impl_->Next();
}
-char TGetOpt::TIterator::Key() const noexcept {
+char TGetOpt::TIterator::Key() const noexcept {
return Impl_->Key();
}
-bool TGetOpt::TIterator::AtEnd() const noexcept {
+bool TGetOpt::TIterator::AtEnd() const noexcept {
if (Impl_.Get()) {
return Impl_->AtEnd();
}
@@ -94,7 +94,7 @@ bool TGetOpt::TIterator::AtEnd() const noexcept {
return true;
}
-const char* TGetOpt::TIterator::Arg() const noexcept {
+const char* TGetOpt::TIterator::Arg() const noexcept {
if (Impl_.Get()) {
return Impl_->Arg();
}
@@ -102,7 +102,7 @@ const char* TGetOpt::TIterator::Arg() const noexcept {
return nullptr;
}
-TGetOpt::TGetOpt(int argc, const char* const* argv, const TString& format)
+TGetOpt::TGetOpt(int argc, const char* const* argv, const TString& format)
: Impl_(new TImpl(argc, argv, format))
{
}