Skip to content

Commit d55a79e

Browse files
spcaipers-armthorstendb-ARMedriouk
authored
[packchk] refactored name and version (#1146) (#1968)
refactored name and version Co-authored-by: Thorsten de Buhr <[email protected]> Co-authored-by: Evgueni Driouk <[email protected]>
1 parent 69713f5 commit d55a79e

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

tools/packchk/src/PackChk.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,29 +175,21 @@ bool PackChk::CheckPackage()
175175
int PackChk::Check(int argc, const char* argv[], const char* envp[])
176176
{
177177
const string header = m_packOptions.GetHeader();
178-
LogMsg("M001", TXT(header));
178+
cout << header << endl;
179179

180180
ParseOptions parseOptions(m_packOptions);
181181
ParseOptions::Result result = parseOptions.Parse(argc, argv);
182182

183-
// Add date and time to log file
184-
if(!m_packOptions.GetLogPath().empty()) {
185-
string dateTime = m_packOptions.GetCurrentDateTime();
186-
LogMsg("M002", TXT("Log created on "), TXT2(dateTime));
187-
}
188-
189183
switch(result) {
190184
case ParseOptions::Result::Ok:
191185
break;
192186
case ParseOptions::Result::ExitNoError:
193187
return 0;
194188
case ParseOptions::Result::Error:
195-
if(!ErrLog::Get()->GetErrCnt()) {
196-
LogMsg("M105");
197-
}
198189
return 1;
199190
}
200191

192+
LogMsg("M001", TXT(header));
201193
bool bOk = CheckPackage();
202194

203195
if(ErrLog::Get()->GetErrCnt() || !bOk) {

tools/packchk/src/PackOptions.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ bool CPackOptions::SetDisableValidation(bool bDisable)
340340
*/
341341
const string CPackOptions::GetVersionInfo()
342342
{
343-
return ORIGINAL_FILENAME + string(" ") + VERSION_STRING + " " + COPYRIGHT_NOTICE;
343+
return VERSION_STRING;
344344
}
345345

346346
/**
@@ -360,14 +360,7 @@ const string CPackOptions::GetVersion()
360360
*/
361361
const string CPackOptions::GetHeader()
362362
{
363-
string header = string(PRODUCT_NAME);
364-
header += " ";
365-
header += GetVersion();
366-
header += " ";
367-
header += string(COPYRIGHT_NOTICE);
368-
header += "\n";
369-
370-
return header;
363+
return ORIGINAL_FILENAME + string(" ") + VERSION_STRING + " " + COPYRIGHT_NOTICE;
371364
}
372365

373366
/**

tools/packchk/src/ParseOptions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,12 @@ bool ParseOptions::SetDisableValidation(bool bDisable)
193193
*/
194194
ParseOptions::Result ParseOptions::Parse(int argc, const char* argv[])
195195
{
196-
const string header = m_packOptions.GetHeader();
197196
const string fileName = m_packOptions.GetProgramName();
198197
bool bOk = true;
199198
cxxopts::ParseResult parseResult;
200199

201200
try {
202-
cxxopts::Options options(fileName, header);
201+
cxxopts::Options options(fileName);
203202

204203
options
205204
.set_width(80)

0 commit comments

Comments
 (0)