diff options
Diffstat (limited to 'zen/cmds/copy.cpp')
| -rw-r--r-- | zen/cmds/copy.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/zen/cmds/copy.cpp b/zen/cmds/copy.cpp index 571a9e092..4ce09c982 100644 --- a/zen/cmds/copy.cpp +++ b/zen/cmds/copy.cpp @@ -3,11 +3,10 @@ #include "copy.h" #include <zencore/filesystem.h> +#include <zencore/logging.h> #include <zencore/string.h> #include <zencore/timer.h> -#include <spdlog/spdlog.h> - CopyCommand::CopyCommand() { m_Options.add_options()("h,help", "Print help"); @@ -38,10 +37,10 @@ CopyCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) // Validate arguments if (m_CopySource.empty()) - throw std::exception("No source specified"); + throw std::runtime_error("No source specified"); if (m_CopyTarget.empty()) - throw std::exception("No target specified"); + throw std::runtime_error("No target specified"); std::filesystem::path FromPath; std::filesystem::path ToPath; @@ -54,12 +53,12 @@ CopyCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) if (!IsFileCopy && !IsDirCopy) { - throw std::exception("Invalid source specification (neither directory nor file)"); + throw std::runtime_error("Invalid source specification (neither directory nor file)"); } if (IsFileCopy && IsDirCopy) { - throw std::exception("Invalid source specification (both directory AND file!?)"); + throw std::runtime_error("Invalid source specification (both directory AND file!?)"); } if (IsDirCopy) @@ -71,7 +70,7 @@ CopyCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (std::filesystem::is_regular_file(ToPath)) { - throw std::exception("Attempted copy of directory into file"); + throw std::runtime_error("Attempted copy of directory into file"); } } } @@ -90,7 +89,7 @@ CopyCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) CopyOptions.EnableClone = !m_NoClone; zen::CopyFile(FromPath, ToPath, CopyOptions); - spdlog::info("Copy completed in {}", zen::NiceTimeSpanMs(Timer.getElapsedTimeMs())); + ZEN_INFO("Copy completed in {}", zen::NiceTimeSpanMs(Timer.getElapsedTimeMs())); } return 0; |