From 624a385fedad5984f045bc9ff8558ffcf8508e30 Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Mon, 28 Mar 2022 15:41:24 +0200 Subject: [PATCH] Improved CLI error reporting --- grapher/lib/grapher/utils/cli.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/grapher/lib/grapher/utils/cli.cpp b/grapher/lib/grapher/utils/cli.cpp index 9a5d10b..7bcdedb 100644 --- a/grapher/lib/grapher/utils/cli.cpp +++ b/grapher/lib/grapher/utils/cli.cpp @@ -18,7 +18,8 @@ build_category(llvm::cl::list const &benchmark_path_list) { fs::path bench_path(bench_path_str.data()); if (!fs::is_directory(bench_path)) { - llvm::errs() << "[WARNING] Not a directory: " << bench_path << '\n'; + llvm::errs() << "[WARNING] Not a directory: " << bench_path + << " (current path: " << fs::current_path() << ").\n"; continue; } @@ -36,7 +37,9 @@ build_category(llvm::cl::list const &benchmark_path_list) { std::istringstream iss(entry_dir.path().filename().stem()); if (!(iss >> iteration.size)) { llvm::errs() << "[WARNING] Entry directory name is not a size: " - << entry_dir.path() << '\n'; + << entry_dir.path() + << " (current path: " << fs::current_path() << ").\n"; + continue; } } @@ -49,7 +52,9 @@ build_category(llvm::cl::list const &benchmark_path_list) { if (!std::filesystem::is_regular_file(sample_path_entry)) { llvm::errs() << "[WARNING] Invalid repetition file (not a regular file): " - << sample_path_entry.path() << '\n'; + << sample_path_entry.path() + << " (current path: " << fs::current_path() << ").\n"; + continue; }