void message::compgen_wordlist_longoptions(ostream &os, const po::options_description &desc) { bool first=true; for (const boost::shared_ptr<po::option_description> &option : desc.options()) { if(!first) os << ' '; else first = false; os << option->canonical_display_name(1); } }
void printHelp(const po::options_description& desc, const po::positional_options_description& posOpts) { std::vector<std::string> parts; parts.push_back("Usage: ntfs_linker"); for (unsigned int i = 0; i < posOpts.max_total_count(); ++i) { parts.push_back(posOpts.name_for_position(i)); } if (desc.options().size() > 0) { parts.push_back("[options]"); } std::stringstream ss; std::copy(parts.begin(), parts.end(), std::ostream_iterator<std::string>(ss, " ")); std::cout << "ntfs-linker, Copyright (c) Stroz Friedberg, LLC" << std::endl; std::cout << "Version " << VERSION << std::endl; std::cout << ss.str() << std::endl; std::cout << desc << std::endl; }