From da6a57b203c359c864458d10e8f7202ef8c555d0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 7 Jan 2015 18:43:14 -0500 Subject: [PATCH] Hooks - The 'diag' command should indicate misnamed hook scripts (thanks to Tomas Babej). --- ChangeLog | 2 ++ src/commands/CmdDiagnostics.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index cd4ca5fdb..3e27b1cf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ - Changed assorted reports so they do not use '.age' format for dates that are in the future, because those are never shown with this format (thanks to Sujeevan Vijayakumaran). +- The 'diag' command should indicate misnamed hook scripts (thanks to Tomas + Babej). ------ current release --------------------------- diff --git a/src/commands/CmdDiagnostics.cpp b/src/commands/CmdDiagnostics.cpp index d58d99391..fc58a83c2 100644 --- a/src/commands/CmdDiagnostics.cpp +++ b/src/commands/CmdDiagnostics.cpp @@ -322,10 +322,15 @@ int CmdDiagnostics::execute (std::string& output) for (h = hooks.begin (); h != hooks.end (); ++h) { Path p (*h); + std::string name = p.name (); out << " " << *h << (p.executable () ? " (executable)" : " (not executable)") << (p.is_link () ? " (symlink)" : "") + << ((name.substr (0, 6) == "on-add" || + name.substr (0, 9) == "on-modify" || + name.substr (0, 9) == "on-launch" || + name.substr (0, 7) == "on-exit") ? "" : " (unrecognized hook name)") << "\n"; } }