mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-24 15:16:40 +00:00
clean up some error output
This commit is contained in:
parent
4da9bed4fa
commit
afcbc6dd9f
4
one.cpp
4
one.cpp
@ -250,11 +250,9 @@ static int cli(int argc,char **argv)
|
|||||||
homeDir = OneService::platformDefaultHomePath();
|
homeDir = OneService::platformDefaultHomePath();
|
||||||
|
|
||||||
// TODO: cleanup this logic
|
// TODO: cleanup this logic
|
||||||
// A lot of generic CLI errors land here; missing admin rights cause a bit of this.
|
|
||||||
if ((!port)||(!authToken.length())) {
|
if ((!port)||(!authToken.length())) {
|
||||||
if (!homeDir.length()) {
|
if (!homeDir.length()) {
|
||||||
fprintf(stderr,"%s: missing port or authentication token and no home directory specified to auto-detect" ZT_EOL_S,argv[0]);
|
fprintf(stderr,"%s: missing port or authentication token and no home directory specified to auto-detect" ZT_EOL_S,argv[0]);
|
||||||
fprintf(stderr, "If you did not, please run this command as an Administrator / sudo / Root user. Thanks!");
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,7 +262,6 @@ static int cli(int argc,char **argv)
|
|||||||
port = Utils::strToUInt(portStr.c_str());
|
port = Utils::strToUInt(portStr.c_str());
|
||||||
if ((port == 0)||(port > 0xffff)) {
|
if ((port == 0)||(port > 0xffff)) {
|
||||||
fprintf(stderr,"%s: missing port and zerotier-one.port not found in %s" ZT_EOL_S,argv[0],homeDir.c_str());
|
fprintf(stderr,"%s: missing port and zerotier-one.port not found in %s" ZT_EOL_S,argv[0],homeDir.c_str());
|
||||||
fprintf(stderr, "If you did not, please run this command as an Administrator / sudo / Root user. Thanks!");
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -287,7 +284,6 @@ static int cli(int argc,char **argv)
|
|||||||
#endif
|
#endif
|
||||||
if (!authToken.length()) {
|
if (!authToken.length()) {
|
||||||
fprintf(stderr,"%s: missing authentication token and authtoken.secret not found (or readable) in %s" ZT_EOL_S,argv[0],homeDir.c_str());
|
fprintf(stderr,"%s: missing authentication token and authtoken.secret not found (or readable) in %s" ZT_EOL_S,argv[0],homeDir.c_str());
|
||||||
fprintf(stderr, "If you did not, please run this command as an Administrator / sudo / Root user. Thanks!");
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user