Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <functional>
00018
00019 #include "absl/container/flat_hash_set.h"
00020 #include "cartographer/io/internal/pbstream_info.h"
00021 #include "cartographer/io/internal/pbstream_migrate.h"
00022 #include "gflags/gflags.h"
00023 #include "glog/logging.h"
00024
00025 int main(int argc, char** argv) {
00026 google::InitGoogleLogging(argv[0]);
00027
00028 FLAGS_logtostderr = true;
00029 const std::string usage_message =
00030 "Swiss Army knife for pbstreams.\n\n"
00031 "Currently supported subcommands are:\n"
00032 "\tinfo - Prints summary of pbstream.\n"
00033 "\tmigrate - Migrates old pbstream (w/o header) to new pbstream format.";
00034 google::ParseCommandLineFlags(&argc, &argv, true);
00035
00036 if (argc < 2) {
00037 google::SetUsageMessage(usage_message);
00038 google::ShowUsageWithFlagsRestrict(argv[0], "pbstream_info_main");
00039 return EXIT_FAILURE;
00040 } else if (std::string(argv[1]) == "info") {
00041 return ::cartographer::io::pbstream_info(argc, argv);
00042 } else if (std::string(argv[1]) == "migrate") {
00043 return ::cartographer::io::pbstream_migrate(argc, argv);
00044 } else {
00045 LOG(INFO) << "Unknown subtool: \"" << argv[1];
00046 google::SetUsageMessage(usage_message);
00047 google::ShowUsageWithFlagsRestrict(argv[0], "pbstream_info_main");
00048 return EXIT_FAILURE;
00049 }
00050 }