From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WEBEBUBanmIMswAAbAwnHQ (envelope-from ) for ; Mon, 06 Jun 2022 21:49:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KOM/BUBanmKeSQAAauVa8A (envelope-from ) for ; Mon, 06 Jun 2022 21:49:20 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AFA013B566 for ; Mon, 6 Jun 2022 21:49:16 +0200 (CEST) Received: from localhost ([::1]:51750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyIix-0001QT-SZ for larch@yhetil.org; Mon, 06 Jun 2022 15:49:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyIiv-0001Pq-GR for gwl-devel@gnu.org; Mon, 06 Jun 2022 15:49:13 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:60417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyIis-00087K-Kz for gwl-devel@gnu.org; Mon, 06 Jun 2022 15:49:12 -0400 Received: from laura.hitronhub.home (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 256Jn1ol029342 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 6 Jun 2022 15:49:09 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 256Jn1ol029342 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1654544949; bh=a0T9GKbWlK7ygF6b4oYAfSc/BZbPvtXmbseD3soIizU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ukL10Lm/fRZG64sYP1ItS44RN2wFAGc7pPxpV3q5D7M6XedgSMQjXPkaAHk93hnT9 3zEgSW1G16F2LoyH49PWO7z0K+q703+cT2ZEqRH5sNFYRByXC9wcyJ5Gy9jeiBgm0o SJmRcPigoxXcogmxO86FciwJN4vFwtvcaa2u2kbU= From: Olivier Dion To: Olivier Dion , 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 Message-Id: <20220606194900.27725-2-olivier.dion@polymtl.ca> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220606194900.27725-1-olivier.dion@polymtl.ca> References: <20220603183203.11092-1-olivier.dion@polymtl.ca> <20220606194900.27725-1-olivier.dion@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Mon, 6 Jun 2022 19:49:01 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: gwl-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+larch=yhetil.org@gnu.org Sender: "gwl-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654544957; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=a0T9GKbWlK7ygF6b4oYAfSc/BZbPvtXmbseD3soIizU=; b=P1UmVhyQqsVCoisa/UXbLF9NTUDWVlJ+JtCV8WXioERC5Lcz8RFBT3W9VjgA9xUEbusMff 9vyI/bi0QKCAPaxRaG8WyyFiZfrmbTV8hQokhr9qVzmIKXvmLQm/J5W4OQW/unZdZyrKki Oslv0ssY06bOFE5bgJFVU4E6v8PKxnaW5VXlzga98S+OzHoWKGmbcNW5KsCrSVqe4GUD6G 7mOKMheolVcDhpKP7K1IY/ErQM90dluKTPeQ9BrSfL+Bk/si8xsZSNiSsQpWgysrZG4xyA vfYUTIS06UhK87a3+t9p8ScxZ3CJ/TjnD5SkGfNmL6xyLm53oFxNhGFs8JNdZA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654544957; a=rsa-sha256; cv=none; b=bK/myX4vj5/dDh6w2E0+CB/LnrUuzzVqATVw9oudirwURD6wv7XdWXntw/Om4G9AZcH77r mxbwZNnlBG3+LVOsh9CPkDGDVOlwZjQ77eYzUg4gVG2M5Ag/6wlO/+uggV4UkfrjtcFhHX OSpn1Wo3DD5zfnjprO6T2de+CQRy55bJ9OkSTXUf/HCwTE900EDRogVVu9BqgypABtL2BG 1OYEmItC1YbRyYT0Cxy690eT73sCbl9bdLTp85Lcj4LH3C93WGTyJezOVyqoV2+zQkgD8T SPw2fMPXJRP8rFIfJi+J4h6fPSuuXoWXoh0A3X87HSNyZKn1A4S+2LfKTQTbRA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=polymtl.ca header.s=default header.b="ukL10Lm/"; dmarc=pass (policy=quarantine) header.from=polymtl.ca; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.71 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=polymtl.ca header.s=default header.b="ukL10Lm/"; dmarc=pass (policy=quarantine) header.from=polymtl.ca; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AFA013B566 X-Spam-Score: -3.71 X-Migadu-Scanner: scn1.migadu.com X-TUID: S4mzvnWYLfm3 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