GNU bug report logs -
#45004
[PATCH shepherd] herd: Suggest alternatives when action and service are likely swapped.
Previous Next
Full log
View this message in rfc822 format
* modules/shepherd/script/herd.scm (run-command)[reply error]: Report a more
descriptive error if service could reasonably have been an action.
---
modules/shepherd/scripts/herd.scm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/shepherd/scripts/herd.scm b/modules/shepherd/scripts/herd.scm
index 106de1e..a178f51 100644
--- a/modules/shepherd/scripts/herd.scm
+++ b/modules/shepherd/scripts/herd.scm
@@ -179,6 +179,15 @@ the daemon via SOCKET-FILE."
('messages messages))
(for-each display-line messages)
(report-command-error error)
+ (match (list action service)
+ ((_ (or 'start 'stop 'status 'doc))
+ (report-error (l10n "did you mean 'herd ~a ~a'?")
+ service action))
+ ((root (or 'help 'halt 'power-off 'load 'eval 'unload 'reload
+ 'daemonize 'persistency 'no-persistency 'cd 'restart))
+ (report-error (l10n "did you mean 'herd ~a ~a'?")
+ service action))
+ ((_ _) *unspecified*))
(exit 1))
((? eof-object?)
;; When stopping shepherd, we may get an EOF in lieu of a real reply,
--
2.29.2
This bug report was last modified 2 years and 42 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.