Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 359da55

Browse files
committed
Added help message.
1 parent eca35e0 commit 359da55

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/maincli.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99

1010
#define GEN_UTIL_CODE
1111

12+
const char* helptext =
13+
"welcome to dbccoder v1.1.\n\n"
14+
"author: Andrey Astakhov (https://github.com/astand)\n\n"
15+
"to use utility you need to provide 3 arguments:\n\n"
16+
"1. dbc file path\n"
17+
"2. directory for generated source codegen\n"
18+
"3. prefix (driver name) which will be used in driver elements naming\n\n"
19+
"Example: ./dbccoder /home/user/docs/driveshaft.dbc /home/user/docs/gen/ drivedb\n\n";
20+
1221
DbcScanner* scanner;
1322
CiMainGenerator* cigen;
1423
CiUtilGenerator* ciugen;
@@ -25,12 +34,7 @@ int main(int argc, char* argv[])
2534
ciugen = new CiUtilGenerator;
2635
fscreator = new FsCreator;
2736

28-
bool numberLines = false; // Default is no line numbers.
29-
3037
if (argc == 4)
31-
numberLines = true;
32-
33-
if (numberLines)
3438
{
3539
std::ifstream reader;
3640
// copy dbc file name to string variable
@@ -69,10 +73,7 @@ int main(int argc, char* argv[])
6973

7074
#if defined (GEN_UTIL_CODE)
7175

72-
73-
// test utility generation
74-
75-
ret = fscreator->PrepareDirectory(dbc_driver_name.c_str() , (source_files_out_path).c_str(), true, info);
76+
ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), (source_files_out_path).c_str(), true, info);
7677

7778
MsgsClassification groups;
7879

@@ -91,8 +92,6 @@ int main(int argc, char* argv[])
9192
}
9293
else
9394
{
94-
std::cout << "Argument list is bad." << std::endl;
95+
std::cout << helptext;
9596
}
96-
97-
std::cout << "Finished... Press any key." << std::endl;
9897
}

0 commit comments

Comments
 (0)