diff --git a/src/main.cpp b/src/main.cpp index 4eb5fec..a7d1dd2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,8 @@ #include #include +#include + /** * application entry point */ @@ -20,6 +22,7 @@ int main(int argc, char *argv[]) { << "[-f] [--force] force refresh of ip" << std::endl << "[-l] [--loop] infinite loop to refresh ip every five minutes" << std::endl << "[-c] [--checkconfig] validate configuration" << std::endl + << "[-ip] [--currentip] get current global ip" << std::endl << "[no argument] normal ip check and refresh" << std::endl; } else if (firstarg == "-v" || firstarg == "--version") { std::cout << "Version " << Version::VERSION << std::endl; @@ -40,6 +43,9 @@ int main(int argc, char *argv[]) { Logger::warning("There are errors in config file!"); return -1; } + } else if (firstarg == "-ip" || firstarg == "--currentip") { + IPAPI ipapi; + std::cout << "Current global IP: " << ipapi.getGlobalIp() << std::endl; } else { Logger::message("wrong arguments! -h for help"); }