unofficial mirror of gwl-devel@gnu.org
 help / color / mirror / Atom feed
From: Olivier Dion <olivier.dion@polymtl.ca>
To: Olivier Dion <olivier.dion@polymtl.ca>, gwl-devel@gnu.org
Subject: [PATCH 2/3] gwl/config: Share log-event switch with subcommands
Date: Mon,  6 Jun 2022 15:48:59 -0400	[thread overview]
Message-ID: <20220606194900.27725-2-olivier.dion@polymtl.ca> (raw)
In-Reply-To: <20220606194900.27725-1-olivier.dion@polymtl.ca>

The alternative would be to define the switch at the top configuration.  Using
`(wanted '((keywords . (log-events))))' for sub-configurations.  However,
there's seem to be a problem in guile-config for correctly parsing global
keywords and sub-commands at the same time.
---
 gwl/config.scm.in | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/gwl/config.scm.in b/gwl/config.scm.in
index 9ab58e5..728eec5 100644
--- a/gwl/config.scm.in
+++ b/gwl/config.scm.in
@@ -42,6 +42,20 @@
 (define %gwl-git-browse-url
   "https://git.sv.gnu.org/cgit/gwl.git")
 
+(define log-event-switch
+  (switch
+   (name 'log-events)
+   (character #\l)
+   (synopsis "Events to log")
+   (default '(execute error info))
+   (example "error,info,execute,cache,debug,guix")
+   (test list?)
+   (handler
+    (lambda (value)
+      (when (string? value)
+        (map string->symbol
+             (string-split value #\,)))))))
+
 (define config
   (configuration
    (name '#{guix workflow}#)
@@ -71,6 +85,7 @@ workflow.")
          (example "/path/to/my-workflow.w"))))
       (keywords
        (list
+        log-event-switch
         (switch
          (name 'verbosity)
          (character #\v)
@@ -78,18 +93,6 @@ workflow.")
          (default 2)
          (test integer?)
          (handler string->number))
-        (switch
-         (name 'log-events)
-         (character #\l)
-         (synopsis "Events to log")
-         (default '(execute error info))
-         (example "error,info,execute,cache,debug,guix")
-         (test list?)
-         (handler
-          (lambda (value)
-            (when (string? value)
-              (map string->symbol
-                   (string-split value #\,))))))
         (switch
          (name 'input)
          (character #\i)
@@ -143,6 +146,9 @@ workflow.")
       (description
        "This command generates a visualization (e.g. in Graphviz Dot
 format) of the specified workflow.")
+      (keywords
+       (list
+        log-event-switch))
       (arguments
        (list
         (argument
-- 
2.36.1



  reply	other threads:[~2022-06-06 19:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03 18:32 [PATCH] gwl/ui: Check for log-events configuration Olivier Dion
2022-06-04 15:00 ` Ricardo Wurmus
2022-06-04 15:10   ` Olivier Dion via
2022-06-06 10:32     ` Ricardo Wurmus
2022-06-06 13:25       ` Olivier Dion via
2022-06-06 18:51         ` Olivier Dion via
2022-06-06 19:48 ` [PATCH 1/3] " Olivier Dion
2022-06-06 19:48   ` Olivier Dion [this message]
2022-06-12  9:03     ` [PATCH 2/3] gwl/config: Share log-event switch with subcommands Ricardo Wurmus
2022-06-06 19:49   ` [PATCH 3/3] graph: Add output switch Olivier Dion
2022-06-12  9:05     ` Ricardo Wurmus
2022-06-12  9:08   ` [PATCH 1/3] gwl/ui: Check for log-events configuration Ricardo Wurmus

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://www.guixwl.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220606194900.27725-2-olivier.dion@polymtl.ca \
    --to=olivier.dion@polymtl.ca \
    --cc=gwl-devel@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.
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).