From d82337d226939a5cbeeb6de1b6708b39bb7a0296 Mon Sep 17 00:00:00 2001 From: Chris Down Date: Tue, 10 Apr 2018 11:07:01 +0100 Subject: [PATCH] Add more debugging information when cache entry is missing This would help with #73. --- clipmenu | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clipmenu b/clipmenu index b039207..0475705 100755 --- a/clipmenu +++ b/clipmenu @@ -59,7 +59,11 @@ file=$cache_dir/$(cksum <<< "$chosen_line") if ! [[ -f "$file" ]]; then # We didn't find this in cache - printf 'FATAL: %s not in cache\n' "$chosen_line" >&2 + printf 'FATAL: %s not in cache (%s missing)\n' "$chosen_line" "$file" >&2 + printf 'Please report the following debug information:\n\n' >&2 + wc -l "$cache_file_prefix"_* >&2 + grep -nFR "$chosen_line" "$cache_dir" >&2 + stat "$file" >&2 exit 2 fi