Skip to content

Commit

Permalink
intermediate changes
Browse files Browse the repository at this point in the history
ref:d8bf853b6878ebcc5889947113f986b54c67ae5a
  • Loading branch information
arcadia-devtools committed Nov 7, 2018
1 parent 7f540a3 commit 1e945f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion library/getopt/small/last_getopt_opts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,12 @@ namespace NLastGetopt {
}

void TOpts::PrintCmdLine(const TStringBuf& program, IOutputStream& os, const NColorizer::TColors& colors) const {
os << colors.BoldColor() << "Usage" << colors.OldColor() << ": " << program << " ";
os << colors.BoldColor() << "Usage" << colors.OldColor() << ": ";
if (CustomUsage) {
os << CustomUsage;
} else {
os << program << " ";
}
if (CustomCmdLineDescr) {
os << CustomCmdLineDescr << Endl;
return;
Expand Down
12 changes: 11 additions & 1 deletion library/getopt/small/last_getopt_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace NLastGetopt {

TString Title; // title of the help string
TString CustomCmdLineDescr; // user defined help string
TString CustomUsage; // user defined usage string

public:
/**
Expand Down Expand Up @@ -306,14 +307,23 @@ namespace NLastGetopt {
size_t IndexOf(const TOpt* opt) const;

/**
* Replase help string with given
* Replace help string with given
*
* @param decr new help string
*/
void SetCmdLineDescr(const TString& descr) {
CustomCmdLineDescr = descr;
}

/**
* Replace usage string with given
*
* @param usage new usage string
*/
void SetCustomUsage(const TString& usage) {
CustomUsage = usage;
}

/**
* Set minimal number of free args
*
Expand Down

0 comments on commit 1e945f6

Please sign in to comment.