Source File: cp.cpp

//https://www.gnu.org/software/coreutils/manual/html_node/cp-invocation.html 

#include <fmt/core.h>
#include <filesystem>
#include <fstream>
#include <iostream>

namespace fs = std::filesystem;

int main(int argc, char* argv[]) {
  if(argc != 3) {
    fmt::println("USAGE: cp <from_file> <to_file>");
    return 1;
  }

  try {
    fs::copy_file(argv[1], argv[2]);
  } catch(fs::filesystem_error &e) {
    fmt::println("failed to copy: {}", e.what());
  }
}