pbstream_main.cc
Go to the documentation of this file.
00001 /*
00002  * Copyright 2018 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
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 }


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:35