From: Leo Prikler <leo.prikler@student.tugraz.at>
To: 45004@debbugs.gnu.org
Subject: [bug#45004] [PATCH shepherd] herd: Suggest alternatives when action and service are likely swapped.
Date: Wed, 2 Dec 2020 10:21:07 +0100 [thread overview]
Message-ID: <20201202092106.22770-1-leo.prikler@student.tugraz.at> (raw)
* 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
next reply other threads:[~2020-12-02 10:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 9:21 Leo Prikler [this message]
2020-12-02 20:03 ` [bug#45004] [PATCH shepherd] herd: Suggest alternatives when action and service are likely swapped Jonathan Brielmaier
2020-12-04 17:18 ` Oleg Pykhalov
2023-06-02 13:56 ` [bug#45004] Bash completion for ‘herd’ Ludovic Courtès
2023-06-02 22:23 ` Oleg Pykhalov
2023-06-02 14:04 ` bug#45004: [PATCH shepherd] herd: Suggest alternatives when action and service are likely swapped Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201202092106.22770-1-leo.prikler@student.tugraz.at \
--to=leo.prikler@student.tugraz.at \
--cc=45004@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).