27 #include "core/version.hpp"
29 #include <boost/program_options.hpp>
36 showUsage(std::ostream& os,
const boost::program_options::options_description& cmdOptions)
38 os <<
"Usage: nfd-status [options]\n\n"
39 <<
"Show NFD version and status information.\n\n"
47 static std::tuple<int, StatusReportOptions>
52 namespace po = boost::program_options;
53 po::options_description cmdOptions(
"StatusReportOptions");
54 cmdOptions.add_options()
55 (
"help,h",
"print this help message")
56 (
"version,V",
"show program version")
58 (
"channels,c", po::bool_switch(&options.
wantChannels),
"show channels")
59 (
"faces,f", po::bool_switch(&options.
wantFaces),
"show faces")
60 (
"fib,b", po::bool_switch(&options.
wantFib),
"show FIB entries")
61 (
"rib,r", po::bool_switch(&options.
wantRib),
"show RIB routes")
63 (
"xml,x",
"output as XML instead of text (implies -vcfbrs)");
66 po::store(po::command_line_parser(args).options(cmdOptions).run(), vm);
69 catch (
const po::error& e) {
70 std::cerr << e.what() <<
"\n";
72 return std::make_tuple(2, options);
75 if (vm.count(
"help") > 0) {
77 return std::make_tuple(0, options);
79 if (vm.count(
"version") > 0) {
80 std::cout <<
"nfd-status " << NFD_VERSION_BUILD_STRING <<
"\n";
81 return std::make_tuple(0, options);
84 if (vm.count(
"xml") > 0) {
94 return std::make_tuple(-1, options);
102 auto args = ctx.
args.
get<std::vector<std::string>>(
"args");
context for command execution
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
const CommandArguments & args