Skip to content

Commit

Permalink
Add SetUsageMessage For daemons (#4134)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperYoko authored and Sophie-Xie committed Apr 13, 2022
1 parent 50159ab commit c1ab867
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/daemons/GraphDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ DECLARE_bool(containerized);

int main(int argc, char *argv[]) {
google::SetVersionString(nebula::versionString());
google::SetUsageMessage("Usage: " + std::string(argv[0]) + " [options]");
if (argc == 1) {
printHelp(argv[0]);
return EXIT_FAILURE;
Expand Down
1 change: 1 addition & 0 deletions src/daemons/MetaDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ extern Status setupBreakpad();

int main(int argc, char* argv[]) {
google::SetVersionString(nebula::versionString());
google::SetUsageMessage("Usage: " + std::string(argv[0]) + " [options]");
// Detect if the server has already been started
// Check pid before glog init, in case of user may start daemon twice
// the 2nd will make the 1st failed to output log anymore
Expand Down
1 change: 1 addition & 0 deletions src/daemons/StandAloneDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ DEFINE_int32(meta_port, 45500, "Meta daemon listening port");

int main(int argc, char *argv[]) {
google::SetVersionString(nebula::versionString());
google::SetUsageMessage("Usage: " + std::string(argv[0]) + " [options]");
gflags::ParseCommandLineFlags(&argc, &argv, false);

if (argc == 1) {
Expand Down
1 change: 1 addition & 0 deletions src/daemons/StorageDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ extern Status setupBreakpad();

int main(int argc, char *argv[]) {
google::SetVersionString(nebula::versionString());
google::SetUsageMessage("Usage: " + std::string(argv[0]) + " [options]");
// Detect if the server has already been started
// Check pid before glog init, in case of user may start daemon twice
// the 2nd will make the 1st failed to output log anymore
Expand Down

0 comments on commit c1ab867

Please sign in to comment.