[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 03/13: service: Turn 'doc' method into a procedure.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 03/13: service: Turn 'doc' method into a procedure. |
Date: |
Sun, 16 Apr 2023 17:38:36 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit 853d1a0eb357f2e8c02d0e0848363320055f8926
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Apr 11 21:46:09 2023 +0200
service: Turn 'doc' method into a procedure.
* modules/shepherd/service.scm (doc): Rename to...
(display-service-documentation): ... this. Turn into a regular
procedure. Keep private.
(action): Adjust accordingly.
---
modules/shepherd/service.scm | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 60e8f79..769828f 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -77,7 +77,6 @@
start-in-the-background
stop
action
- doc
lookup-running
for-each-service
@@ -870,7 +869,7 @@ is not already running, and will return SERVICE's canonical
name in a list."
(service-canonical-name obj))))
((doc)
(lambda (_ . args)
- (apply doc obj args)))
+ (apply display-service-documentation obj args)))
(else
(lambda _
;; FIXME: Unknown service.
@@ -909,34 +908,34 @@ is not already running, and will return SERVICE's
canonical name in a list."
(report-exception the-action obj key args)))))))
;; Display documentation about the service.
-(define-method (doc (obj <service>) . args)
+(define (display-service-documentation service . args)
(if (null? args)
;; No further argument given -> Normal level of detail.
- (local-output (service-documentation obj))
+ (local-output (service-documentation service))
(case (string->symbol (car args)) ;; Does not work with strings.
((full)
;; FIXME
- (local-output (service-documentation obj)))
+ (local-output (service-documentation service)))
((short)
;; FIXME
- (local-output (service-documentation obj)))
+ (local-output (service-documentation service)))
((action)
;; Display documentation of given actions.
(for-each
(lambda (the-action)
(let ((action-object
- (lookup-service-action obj (string->symbol the-action))))
+ (lookup-service-action service (string->symbol the-action))))
(unless action-object
(raise (condition (&unknown-action-error
(action the-action)
- (service obj)))))
+ (service service)))))
(local-output "~a: ~a" the-action
(action-documentation action-object))))
(cdr args)))
((list-actions)
(local-output "~a ~a"
- (service-canonical-name obj)
- (action-list obj)))
+ (service-canonical-name service)
+ (action-list service)))
(else
;; FIXME: Implement doc-help.
(local-output (l10n "Unknown keyword. Try 'doc root help'."))))))
- [shepherd] branch master updated (353a91b -> fbca4e2), Ludovic Courtès, 2023/04/16
- [shepherd] 08/13: shepherd: Factorize command message gathering., Ludovic Courtès, 2023/04/16
- [shepherd] 02/13: monitoring: Log registered service names., Ludovic Courtès, 2023/04/16
- [shepherd] 03/13: service: Turn 'doc' method into a procedure.,
Ludovic Courtès <=
- [shepherd] 04/13: service: Turn 'action' method into a procedure., Ludovic Courtès, 2023/04/16
- [shepherd] 11/13: service: Record time of last startup failures., Ludovic Courtès, 2023/04/16
- [shepherd] 09/13: comm: Capture the client command protocol version., Ludovic Courtès, 2023/04/16
- [shepherd] 07/13: service: 'stop-service' returns the list of stopped services, not names., Ludovic Courtès, 2023/04/16
- [shepherd] 12/13: tests: Remove reference to non-existent file., Ludovic Courtès, 2023/04/16
- [shepherd] 01/13: service: Use 'lookup-service' instead of 'lookup-services'., Ludovic Courtès, 2023/04/16
- [shepherd] 13/13: herd: Report startup failure., Ludovic Courtès, 2023/04/16
- [shepherd] 06/13: service: Turn 'stop' method into a procedure., Ludovic Courtès, 2023/04/16
- [shepherd] 05/13: service: Turn 'start' method into a procedure., Ludovic Courtès, 2023/04/16
- [shepherd] 10/13: Add missing 'l10n' calls., Ludovic Courtès, 2023/04/16