29 #include <ndn-cxx/util/logger.hpp> 46 os <<
"nfdc [-h|--help] [-V|--version] <command> [<args>]\n\n";
48 os <<
"All subcommands:\n";
51 os <<
"Subcommands starting with " << noun <<
":\n";
54 std::vector<const CommandDefinition*> commands = parser.
listCommands(noun, mode);
55 if (commands.empty()) {
60 for (
auto def : commands) {
61 os <<
" " << def->getNoun() <<
' ' << def->getVerb() <<
' ' 62 <<
text::Spaces{
static_cast<int>(LIST_COMMAND_NAME_COLUMN_WIDTH -
63 def->getNoun().size() - def->getVerb().size() - 2)}
64 << def->getTitle() <<
'\n';
67 os <<
"\nSee 'nfdc help <command>' to read about a specific subcommand.\n";
73 std::string manpage =
"nfdc-" + noun;
75 ::execlp(
"man",
"man", manpage.data(),
nullptr);
76 NDN_LOG_FATAL(
"Error opening man page for " << manpage <<
": " << std::strerror(errno));
82 const auto helpOpts = {
"help",
"--help",
"-h"};
83 auto it = std::find_first_of(args.begin(), args.end(), helpOpts.begin(), helpOpts.end());
88 auto noun = args.size() > 0 ? args[0] :
"";
89 auto verb = args.size() > 1 ? args[1] :
"";
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
print a number of whitespaces