MCPcopy Create free account
hub / github.com/avast/retdec / ProgramOptions

Method ProgramOptions

src/retdectool/retdec.cpp:18–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16{
17 public:
18 ProgramOptions(int argc, char *argv[])
19 {
20 if (argc > 0)
21 {
22 _programName = argv[0];
23 }
24
25 for (int i = 1; i < argc; ++i)
26 {
27 std::string c = argv[i];
28
29 if (c == "-i")
30 {
31 inputFile = getParamOrDie(argc, argv, i);
32 }
33 else if (c == "-h" || c == "--help")
34 {
35 printHelpAndDie();
36 }
37 else if (c == "--version")
38 {
39 Log::info() << retdec::utils::version::getVersionStringLong()
40 << "\n";
41 exit(EXIT_SUCCESS);
42 }
43 else
44 {
45 printHelpAndDie();
46 }
47 }
48 }
49
50 std::string getParamOrDie(int argc, char *argv[], int& i)
51 {

Callers

nothing calls this directly

Calls 2

getVersionStringLongFunction · 0.85
getParamOrDieFunction · 0.50

Tested by

no test coverage detected