Merge pull request #690 from Pablohn26/master

Warn about invalid network id instead of help
This commit is contained in:
Adam Ierymenko 2018-04-18 08:05:28 -07:00 committed by GitHub
commit 54218f6c3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -466,7 +466,7 @@ static int cli(int argc,char **argv)
} }
} else if (command == "join") { } else if (command == "join") {
if (arg1.length() != 16) { if (arg1.length() != 16) {
cliPrintHelp(argv[0],stderr); printf("invalid network id" ZT_EOL_S);
return 2; return 2;
} }
requestHeaders["Content-Type"] = "application/json"; requestHeaders["Content-Type"] = "application/json";
@ -494,7 +494,7 @@ static int cli(int argc,char **argv)
} }
} else if (command == "leave") { } else if (command == "leave") {
if (arg1.length() != 16) { if (arg1.length() != 16) {
cliPrintHelp(argv[0],stderr); printf("invalid network id" ZT_EOL_S);
return 2; return 2;
} }
unsigned int scode = Http::DEL( unsigned int scode = Http::DEL(
@ -592,7 +592,7 @@ static int cli(int argc,char **argv)
} }
} else if (command == "set") { } else if (command == "set") {
if (arg1.length() != 16) { if (arg1.length() != 16) {
cliPrintHelp(argv[0],stderr); printf("invalid network id" ZT_EOL_S);
return 2; return 2;
} }
std::size_t eqidx = arg2.find('='); std::size_t eqidx = arg2.find('=');