Skip to content

Commit

Permalink
Added --version
Browse files Browse the repository at this point in the history
  • Loading branch information
crondaemon committed Nov 6, 2014
1 parent 52694f7 commit 6f24e03
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ using namespace std;

struct option opts[] = {
{"src-ip", 1, NULL, 0},
{"version", 0, NULL, 1},
{"sport", 1, NULL, 2},
{"dport", 1, NULL, 3},
{"txid", 1, NULL, 4},
Expand Down Expand Up @@ -112,8 +113,6 @@ int main(int argc, char* argv[])
vector<string> tokens;
uint32_t upstream = 0;

cout << "\nDines " << PACKAGE_VERSION << " - The definitive DNS packet forger.\n\n";

if (argc == 1) {
usage(argv[0]);
return 1;
Expand All @@ -139,6 +138,11 @@ int main(int argc, char* argv[])
}
break;

case 1: // version
cout << string(PACKAGE_VERSION) << "\n";
return 0;
break;

case 2: // sport
if (optarg[0] == 'F') {
p.fuzzSport();
Expand Down Expand Up @@ -263,7 +267,6 @@ int main(int argc, char* argv[])
return 0;

default:
cout << "Unknown option: " << optarg << endl;
return 1;
}
}
Expand All @@ -272,6 +275,8 @@ int main(int argc, char* argv[])
return 2;
}

cout << "\nDines " << PACKAGE_VERSION << " - The definitive DNS packet forger.\n\n";

#ifndef DEBUG
try {
#endif
Expand Down

0 comments on commit 6f24e03

Please sign in to comment.