int _main()

in include/poac/subcmd/search.hpp [74:100]


        int _main(VS&& argv) {
            using namespace boost::property_tree;

            const bool verbose = util::argparse::use(argv, "-v", "--verbose");

            const auto pt = get_search_api(argv[0]);
            if (verbose) {
                std::stringstream ss;
                json_parser::write_json(ss, pt);
                std::cout << ss.str() << std::endl;
            }

            echo_first_line();
            for (const ptree::value_type& child : pt.get_child("hits")) {
                const ptree& hits = child.second;
                io::cli::set_left(25);
                std::cout << string_pretty(hits.get<std::string>("name"), 21);
                io::cli::set_left(50);
                std::cout << string_pretty(hits.get<std::string>("description"), 45);
                io::cli::set_left(15);
                std::cout << hits.get<std::string>("version")
                          << "    " << hits.get<std::string>("cpp_version")
                          << std::endl;
            }

            return EXIT_SUCCESS;
        }