Files
spark/src/app_sparkd/sparkd/cmds/common/Validators.cpp
T

19 lines
493 B
C++

#include "Validators.h"
#include "spark/utils/FileUtils.h"
#include <fmt/format.h>
namespace bts::cmds {
CLI::Validator Validators::file_exists() {
return CLI::Validator(
[](const std::string &path) -> std::string {
if (spartan::FileUtils::file_exists(path)) {
return "";
}
return fmt::format("The file '{}' does not exist.", path);
},
"file_exists_validator", "Validates that the file exists");
}
} // namespace bts::cmds