void list()

in include/poac/subcmd/cache.hpp [42:61]


        void list(const std::vector<std::string>& argv) {
            namespace fs = boost::filesystem;
            if (argv.empty()) {
                for (const auto &e : boost::make_iterator_range(
                        fs::directory_iterator(io::file::path::poac_cache_dir), {}))
                {
                    std::cout << e.path().filename().string() << std::endl;
                }
            }
            else if (argv.size() == 2 && argv[0] == "--pattern") {
                std::regex pattern(argv[1]);
                for (const auto &e : boost::make_iterator_range(
                        fs::directory_iterator(io::file::path::poac_cache_dir), {}))
                {
                    const std::string cachefile = e.path().filename().string();
                    if (std::regex_match(cachefile, pattern))
                        std::cout << cachefile << std::endl;
                }
            }
        }