text: // Copyright 2020 LabradorWithShades
  // 70892548+LabradorWithShades@users.noreply.github.com
  
  #include <application.hpp>
  
  #include <boost/program_options.hpp>
  
  #include <iostream>
  
  int main(int argc, char* argv[]) {
    namespace po = boost::program_options;
  
    po::options_description desc("Allowed options");
    desc.add_options()
    ("url", po::value<std::string>(), "starting url address")
    ("depth", po::value<size_t>(), "parse depth")
    ("network_threads", po::value<size_t>(), "number of threads for downloading")
    ("parser_threads", po::value<size_t>(), "number of threads for parsing")
    ("output", po::value<std::string>(), "output file name")
    ("help", "produce help message");
  
    po::variables_map vm;
    po::store(po::parse_command_line(argc, argv, desc), vm);
    po::notify(vm);
  
    if (vm.count("help")) {
      std::cout << desc << std::endl;
      return 0;
    }
  
    std::string url{};
    size_t depth{};
    size_t netThreads{};
    size_t parseThreads{};
    std::string filename{};
  
    if (vm.count("url"))
      url = vm["url"].as<std::string>();
    else
      url = "https://bmstu.ru/";
  
    if (vm.count("depth"))
      depth = vm["depth"].as<size_t>();
    else
      depth = 1;
  
    if (vm.count("network_threads"))
      netThreads = vm["network_threads"].as<size_t>();
    else
      netThreads = 1;
  
    if (vm.count("parser_threads"))
      parseThreads = vm["parser_threads"].as<size_t>();
    else
      parseThreads = 1;
  
    if (vm.count("output"))
      filename = vm["output"].as<std::string>();
    else
      filename = "images.txt";
  
    Application app(url, depth, netThreads, parseThreads, filename);
  
    app.start();
    app.waitForFinish();
  
    return 0;
  }