summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2018-11-28 08:44:12 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2018-11-28 08:44:12 -0800
commit52c4385c16ec1e989369d550e0f720a050f72e32 (patch)
treeb0e3586420a01ef610affa8844c2abe93cf54cfd
parent65e0a747183214396eb2b8cf5a2cb4dec64b1987 (diff)
parent04de2302a7987d6046abed7b8c970488ed314e58 (diff)
downloadinfinitytier-52c4385c16ec1e989369d550e0f720a050f72e32.tar.gz
infinitytier-52c4385c16ec1e989369d550e0f720a050f72e32.zip
Merge branch 'master' of http://git.int.zerotier.com/zerotier/ZeroTierOne
-rw-r--r--one.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/one.cpp b/one.cpp
index b770451c..0b18ed91 100644
--- a/one.cpp
+++ b/one.cpp
@@ -630,7 +630,7 @@ static int cli(int argc,char **argv)
}
} else if (command == "get") {
if (arg1.length() != 16) {
- cliPrintHelp(argv[0],stderr);
+ fprintf(stderr,"invalid network ID format, must be a 16-digit hexidecimal number\n");
return 2;
}
char jsons[1024], cl[128];
@@ -654,16 +654,21 @@ static int cli(int argc,char **argv)
printf("%u %s invalid JSON response (unknown exception)" ZT_EOL_S,scode,command.c_str());
return 1;
}
+ bool bNetworkFound = false;
if (j.is_array()) {
for(unsigned long i=0;i<j.size();++i) {
nlohmann::json &n = j[i];
if (n.is_object()) {
if (n["id"] == arg1) {
printf("%s\n", OSUtils::jsonString(n[arg2],"-").c_str());
+ bNetworkFound = true;
}
}
}
}
+ if (!bNetworkFound) {
+ fprintf(stderr,"unknown network ID, check that you are a member of the network\n");
+ }
if (scode == 200) {
return 0;
} else {