civodul pushed a commit to branch devel
in repository shepherd.
commit 9a27e81b861ad1ad59e27f3237262692926982be
Author: Ludovic Courtès <[email protected]>
AuthorDate: Sat Oct 12 11:57:10 2024 +0200
herd: Show ‘list-actions’ hint only when the error is ‘action-not-found’.
* modules/shepherd/scripts/herd.scm (run-command): Show ‘list-actions’
hint only when ERROR is an ‘action-not-found’ error.
---
modules/shepherd/scripts/herd.scm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/shepherd/scripts/herd.scm
b/modules/shepherd/scripts/herd.scm
index 15ae02b..f875a8e 100644
--- a/modules/shepherd/scripts/herd.scm
+++ b/modules/shepherd/scripts/herd.scm
@@ -888,9 +888,12 @@ service but display a generic overview rather than
information about
(report-hint (l10n "Did you mean 'herd ~a ~a'?")
service action))
((_ _)
- (report-hint (l10n "Run 'herd doc ~a list-actions' to list \
+ (match error
+ (('error ('version 0 _ ...) 'action-not-found action service)
+ (report-hint (l10n "Run 'herd doc ~a list-actions' to list \
supported actions.")
- service)))
+ service))
+ (_ #f))))
(exit 1))
((? eof-object?)