From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IO0SA8QsLmGO/wAAgWs5BA (envelope-from ) for ; Tue, 31 Aug 2021 15:21:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0Fk3OsMsLmFTWwAAB5/wlQ (envelope-from ) for ; Tue, 31 Aug 2021 13:21:07 +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 9E5BA1FD19 for ; Tue, 31 Aug 2021 15:21:07 +0200 (CEST) Received: from localhost ([::1]:36364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL3hK-0005LI-CX for larch@yhetil.org; Tue, 31 Aug 2021 09:21:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL3Xb-0004br-RA for guix-patches@gnu.org; Tue, 31 Aug 2021 09:11:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mL3Xb-0001Py-Hv for guix-patches@gnu.org; Tue, 31 Aug 2021 09:11:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mL3Xa-0003ZF-8I for guix-patches@gnu.org; Tue, 31 Aug 2021 09:11: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 13:11:02 +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 Cc: 50296@debbugs.gnu.org Received: via spool by 50296-submit@debbugs.gnu.org id=B50296.163041540813602 (code B ref 50296); Tue, 31 Aug 2021 13:11:02 +0000 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 13:10:08 +0000 Received: from localhost ([127.0.0.1]:33291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL3Wh-0003XK-Lu for submit@debbugs.gnu.org; Tue, 31 Aug 2021 09:10:07 -0400 Received: from mail-qk1-f182.google.com ([209.85.222.182]:44953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL3Wd-0003WY-VC for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 09:10:05 -0400 Received: by mail-qk1-f182.google.com with SMTP id c10so19379540qko.11 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 06:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=vLOe/RWWzyQsXlVkzCVp6gP6rYKlzVuB8pFdTbUw8OI=; b=Xp6h4j3aZaVjUMwRkm6SLtxSW0yf2u5WqU4d6ISTm7D0UHihiaXyEzZq8+FaZiJrwi pTwZ3vRSUna/o7+nQzVmNiv6oOyhyc9ZrqDsPt5FO4wdpAFkv1lcrhdebon859sKgMUC Xdiu+DvdwGytnu1j7Cx1Og9sk8GP84VC5rpd1d7vpXOP6VQPyAK1R8Np/NEZjjxHa7jN N2XUvL8ndgv36rDB9ciINyUStHOxH6Xy9pjf31EpetuSsyZbcHhio59fKhsjWjvHOPnk 9GH5MjDMNWspwVhZaoR8BEPr95VWkPsR46pnSrD6vMJDs7r2AqOAVW02j/zwCuzBYQXi cMAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vLOe/RWWzyQsXlVkzCVp6gP6rYKlzVuB8pFdTbUw8OI=; b=dA8B7X4BO2TpSHK6uXbPg1V8P1LNkJUGvw1h3OvviBmjfUDzduAGuO/x7/T+gzS/Ho P7EzgboyCvMEghqPsxwF2cXcSskOOKqqX9iCzGRgSNLVe5YQzeVIQCH9TTxwhVexWM08 ESPWUfzpgBnLJzUWSW1fc/LmFnmWvIqB6kDb9IcwYRfesrG9hK1fg1vwHtSBV9lLJoPV 4RomSRHD1yc/uXbVMXsfHLMqLnc8uGeFY/DSDBvlihFQt8YM/Ohn1rm4DVkVaR7bexlc RypQTsQ+XeJo8QVNozC2OmCh7GH5RqieJSxq55s/2jsCyMxpedS6XSGfsL0ekT6KhS84 tsjA== X-Gm-Message-State: AOAM533HjHRg3IyPY1YAwKoYY6+Lpeyg9L+W86izvr6vR8rzV+0PLF2n e+6vJD29kmYQON9K6STEPrxf+rgUp4+fA7wIpSw= X-Google-Smtp-Source: ABdhPJwF3HIpd/gs8d+HdzKRHNMPg9/Pk9Z4doz6MP4OmcAUuiPVSm25xKIdSKEEy+LH51e7r+skF+qevUyXmgjdJpk= X-Received: by 2002:a05:620a:1aa7:: with SMTP id bl39mr3084587qkb.304.1630415398535; Tue, 31 Aug 2021 06:09:58 -0700 (PDT) MIME-Version: 1.0 References: <874kb6j718.fsf@trop.in> <87y28ihs07.fsf@trop.in> <86pmttopfk.fsf@gmail.com> <87ilzlizit.fsf@trop.in> In-Reply-To: <87ilzlizit.fsf@trop.in> From: zimoun Date: Tue, 31 Aug 2021 15:09:47 +0200 Message-ID: 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=1630416067; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=vLOe/RWWzyQsXlVkzCVp6gP6rYKlzVuB8pFdTbUw8OI=; b=ocJLM8mSYhq4cz0d/9IkpLGbjH+gWGxAgIA2LQuxE3sjONRewPX/Melmf9HfCcSSFZBINN nEigvtAYzPCAhOpzWR933qw0j5Sa3JZOZYJ7J/xANLsitSj2dVIzUgyQKhTuapE9/8myDV gm+kZxSPWE05Iroj5K78Rwlgbr3XQMSGX5x21AslThQYsRthiRpKMswuRfr/WfHJBEuj5R dsxEOQXtnXt6gzbS3Ndcy3m5eVzTD9n4HG4JDu9H/7sS8CwJlpRxBegeJxKTtNpyMiHivM 8iqI0Pa2IC2qFvs1s4ELg+46OrWWi1Qwu1P+1U4PhMXKfn4VP40sN7aYnaGUhw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630416067; a=rsa-sha256; cv=none; b=nXlWioDawbJ3axvp1eZ4RPrGEnoZymI3X+yXZkZzSsWAxupDLdHpr+cTi46KWxfa1ePofx ROQtOtSokNhdb7EqyEWf3lijX4HPIvMy/Zdg71CCX+kv0OjyGYPWUnv/flr0Y2ACsbAGv7 9MuHbKGsPX3s28Anl9hkDJyDuqm0RwAQ7itluH9TZNywjfItUR6ohkTYTVgv1bb2SHK5IR /Zst0B4/zrb66Rnj+uiEq64vF9qWDe9lTYNBKf7jvJ1hAc5FipGeM8lo3Pd0m8em+ObDSC keqSws2XWYgDGhUIyc48/LvaW91Rvz/DUsG4yg/M1zHETUgazXNaWukRLo+FuQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=Xp6h4j3a; 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=Xp6h4j3a; 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: 9E5BA1FD19 X-Spam-Score: 0.18 X-Migadu-Scanner: scn0.migadu.com X-TUID: tJEPzz0Cm7Sc Hi, On Tue, 31 Aug 2021 at 14:12, Andrew Tropin wrote: > On 2021-08-31 12:53, zimoun wrote: > > 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 th= e > > action is unknown, you could use =E2=80=99string-closest=E2=80=99 and s= o return an hint > > if there is a typo. [...] > Sounds good, the same "issue" exists for guix system subcommands, it > would be cool to have such functionality, but I would like to have those > changes to both guix system and guix home after wip-guix-home merged, > because backporting changes to rde is a little tedious. Your point is to hint both "guix system" and "guix home" in the same time because they share the same pattern. Right? > Also, it seems related to subcommands/--arguments discussion and maybe > better to talk about it in a separate thread. Yes, and from my understanding, your answer is keep consistency with "guix system". :-) Cheers, simon