From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GITtL0EQLmF3yQAAgWs5BA (envelope-from ) for ; Tue, 31 Aug 2021 13:19:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eCCWK0EQLmEiCQAAB5/wlQ (envelope-from ) for ; Tue, 31 Aug 2021 11:19:29 +0000 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 7DA241D768 for ; Tue, 31 Aug 2021 13:19:29 +0200 (CEST) Received: from localhost ([::1]:56694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL1nc-0000IE-HK for larch@yhetil.org; Tue, 31 Aug 2021 07:19:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL1nC-0000H7-Fb for guix-patches@gnu.org; Tue, 31 Aug 2021 07:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mL1nC-000094-7j for guix-patches@gnu.org; Tue, 31 Aug 2021 07:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mL1nC-0004wi-1P for guix-patches@gnu.org; Tue, 31 Aug 2021 07:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50296] [PATCH 1/2] scripts: Add 'guix home'. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 31 Aug 2021 11:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50296 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Andrew Tropin , 50296@debbugs.gnu.org Received: via spool by 50296-submit@debbugs.gnu.org id=B50296.163040868918946 (code B ref 50296); Tue, 31 Aug 2021 11:19:01 +0000 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 11:18:09 +0000 Received: from localhost ([127.0.0.1]:33162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL1mL-0004vW-9w for submit@debbugs.gnu.org; Tue, 31 Aug 2021 07:18:09 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:44749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL1mF-0004un-HT for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 07:18:03 -0400 Received: by mail-wr1-f53.google.com with SMTP id g18so19559568wrc.11 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 04:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=rlyGHTwlQXlPS+NAJqcu5frYAEY+nnV4V9+CDjfq4YQ=; b=nPiWEGmWMcPEV8jcfEdTrL9j0A/j99SLNUPxy+1/CbjbxagP8QqGlTm7Qy3o/W1Smz QX0DyPu3IB0X4rfyX7/UBLMgbUxWihg9F4Las6qshXKg0sOjwa8f+iZsG3b9yV94wdTb dQ39froseQze0j/HTgHUvhSxeMbUCg43fymdajwK4sBjLrUcZaVM9XVvau0MFI5WXhiL sjwSRD+iDwia/YxTzri86GCE5SBEzabb1I69VjavoLbnf6u5u6VWpHRv50QMR1Vfony7 ZaIJeAzB3vpaWt+fVBgmY6SfylMG4zte13w1U1ukCA4/BfZmrYYGmf2JX8WR6POKQ3VA hhhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=rlyGHTwlQXlPS+NAJqcu5frYAEY+nnV4V9+CDjfq4YQ=; b=BTPPOSvVJNOt1UY7Qkuvg5e6IR/wxqCWhI2lsD9Rx0fK/rPHbhukCjlnlaZ5zGwOYF R327hHvO9If9409VoIkIuQ2XdSBciUBgKhaSruCmqDkJ9r48a5pEyvULObskN4rkIzsf 61FS7/FvSOvNKCnZDAT7+EuJkaXd/KRlF4AwNeZl8oCu2jIiiOORByQiqw7iK+FEquWN XwQGafqPB3e9fvoDDb5ldWejUFvhLlOeq3X06PdSPgzPtgPCU9sYFJUmmkbf/gC+2C9L i8c1oBzXPvbuV+34E0N5MF5lCB+Q0gGNOr5rGhmzLqM7Qsz7gdA4L22MVY4BcIvQjav6 sCgw== X-Gm-Message-State: AOAM530n8PUvchQ2yQc1rjObEKvjhtRiNQBTALLfxuk5ScVKj0oIUqaa uIeWyH74VXk2nn3gVahmiNGEaXPJF3pLag== X-Google-Smtp-Source: ABdhPJw1URTF+z9C15IrWs1MTiDFioEfJGVHrjlvZ9EYJl45hYPXdhh9yM6hL6GHEhbCHOOuCPQbBA== X-Received: by 2002:a5d:6148:: with SMTP id y8mr31678283wrt.33.1630408677859; Tue, 31 Aug 2021 04:17:57 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id o2sm13019011wrh.13.2021.08.31.04.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 04:17:57 -0700 (PDT) From: zimoun In-Reply-To: <87y28ihs07.fsf@trop.in> References: <874kb6j718.fsf@trop.in> <87y28ihs07.fsf@trop.in> Date: Tue, 31 Aug 2021 12:53:51 +0200 Message-ID: <86pmttopfk.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630408769; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=rlyGHTwlQXlPS+NAJqcu5frYAEY+nnV4V9+CDjfq4YQ=; b=DNV+RJ4w5Si0dQOmJ9RQPKWGMeFWkYXps1uxDRQFRMOLQ06/Gi8wGrSGGxv7CPoHFCBFMT 622WCe6s98BAGQ0U/Sp0bE/Y6B/Ox3Jz9QMfDPqpM26ETEXZZ7cOqWaDp6FF0rCgaXmi5C LJfy0WUGME0rDcGIW/rEj9ABdoVoQeSgtuVOJPY3wvsurq5k7JCQC9VRSVp1jgPIqyr5bF UOH1x0wJ6707ZaNklW/q5hK9XcQDqfk9OqxDSk9cHBtXQXSwbUOqiNJRBpSNQaqmKzWOw2 bmnjUOZjwv0Qkhb61Cl/t+QyJPOys2EERDsDMqFOblQgXEXO58vkGFhReFPASg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630408769; a=rsa-sha256; cv=none; b=aECoFKmNicArqravBPs+jfvv1bZSbf/Vua5De1Dl/DwC+3pGqudxlhFOLNKpoS2AVMU6Wg REwz6IR2JG4/BPBuVpyx/ZhcnIG5vwVX7hye4vE7XpOownCU8PYVEcO6tk0rp4AmSPHsxn z//gkInP/CtzBV9NlCTCW7epGnSa4pRpibPFJA3+oKPsUjVaMDZMlJex5Z3CXUI99e4mvh 1chPi24gZEEgAIGpYIpCObYPPojwvcL06Ndw0E7EG891xorzqL7h3f11UsP6yQzB71fOS2 /+IxJtpSlJtLYNUvUlYUTw4PxZ8UMpJSmHb3UpqUSH6VK/Fbigzs+4nS9Al8Zg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=nPiWEGmW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=nPiWEGmW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 7DA241D768 X-Spam-Score: 0.18 X-Migadu-Scanner: scn0.migadu.com X-TUID: BPtqrkZKZdTU Hi, On Tue, 31 Aug 2021 at 12:40, Andrew Tropin wrote: > +(define-command (guix-home . args) > + (synopsis "build and deploy home environments") > + > + (define (parse-sub-command arg result) > + ;; Parse sub-command ARG and augment RESULT accordingly. > + (if (assoc-ref result 'action) > + (alist-cons 'argument arg result) > + (let ((action (string->symbol arg))) > + (case action > + ((build > + reconfigure > + extension-graph shepherd-graph > + list-generations describe > + delete-generations roll-back > + switch-generation search > + import) > + (alist-cons 'action action result)) > + (else (leave (G_ "~a: unknown action~%") action)))))) For parsing the actions, I would define elsewhere the list. Then if the action is unknown, you could use =E2=80=99string-closest=E2=80=99 and so re= turn an hint if there is a typo. Other said, this guix home recnfigure would return guix home: error: recnfigure: unknown action hint: Did you mean `reconfigure'? WDYT? Cheers, simon