From 3971a8ab248cce484a1a71193cbea96e3e759a10 Mon Sep 17 00:00:00 2001 From: lukas-heiligenbrunner Date: Mon, 6 May 2019 18:49:38 +0200 Subject: [PATCH] reformated output of main --- src/main.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 20caa1b..7a7184d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,53 +6,54 @@ int main(int argc, char *argv[]) { - if(argc > 1){ + if (argc > 1) { std::string firstarg(argv[1]); - if (firstarg == "-h" || firstarg == "--help"){ - std::cout << "help page: " << std::endl << "[-h] [--help] print this help page" << std::endl << "[-v] [--version] print the software version" < args; - args.add("name", "luki.dynu.net"); + args.add("name", domainname); args.add("ipv4Address", ip); std::vector headers; headers.push_back("accept: application/json"); headers.push_back("User-Agent: Mozilla/5.0 (compatible; Rigor/1.0.0; http://rigor.com)"); - headers.push_back("API-Key: 88vNpMfDhMM2YYDNfWR1DNYfRX9W6fYg"); + headers.push_back("API-Key: " + dynuapikey); std::string dynurepl = api.request("https://api.dynu.com/v2/dns/" + domainid, true, args, headers); - std::cout << "[ DEBUG ] api reply:: " << dynurepl << std::endl; + std::cout << "[DEBUG] api reply:: " << dynurepl << std::endl; if (dynurepl != "{\"statusCode\":200}") { logger.logToLogfile(" [ERROR] failed to write ip to dynu api!");