From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GB4dFuKyKGEbKwAAgWs5BA (envelope-from ) for ; Fri, 27 Aug 2021 11:39:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id eB7fEeKyKGF0BAAAbx9fmQ (envelope-from ) for ; Fri, 27 Aug 2021 09:39:46 +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 30A1D84B8 for ; Fri, 27 Aug 2021 11:39:46 +0200 (CEST) Received: from localhost ([::1]:34904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJYKv-0000G9-5t for larch@yhetil.org; Fri, 27 Aug 2021 05:39:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJYKm-0000G1-4K for guix-devel@gnu.org; Fri, 27 Aug 2021 05:39:36 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:50981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJYKk-0005jK-Ds for guix-devel@gnu.org; Fri, 27 Aug 2021 05:39:35 -0400 Received: by mail-wm1-x331.google.com with SMTP id m2so3495524wmm.0 for ; Fri, 27 Aug 2021 02:39:33 -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=SEeRbF9sD4lKv2xY/qUfyJPWLPXbezLphdrIN4Pshiw=; b=hdEfDjaDM1VPQCuEXi/SiSX+PXIMP6PEuwYc2OKE6rdJzuvdBAAXOsoMKpfflKuiXx 0vHaLT3zzsi/ALl7Y7d8DTgoADGQxk6TdxGqaW2TDRqjoyBSGuylr0Lw9lpE0LzFgFBA OiRK2NNKNz52sKn+CSzYgL7ytJMbrkm8Voh5hsMTKLbsy3WRABg32cLLWueMtqbihqFr Qx/0Uz7W6xD1gJrvnbGvItl43jAf1EgpWlMRIl7gDTD12jVnCm1JnqYUt0LOi0ux8YxB CcfGyaw9M03bGZaKVHy1OuVZdS+nA5raYP/eEv4ircfEszG2E8rL27ueXvTVAuUTY3Or mCEA== 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=SEeRbF9sD4lKv2xY/qUfyJPWLPXbezLphdrIN4Pshiw=; b=rqvUgxKRZblxhpnTDv1iwq+htAifdrbm7j3PbA5xI7A5J8O/E9izOwUe8NnBM695sK lKa7eXv2LYR7yoGud1ApY+zWfMwMbFUK4BZzppwsXgs7TRQpO4N2WjNTcXJmqHieDLKx pDPnDIPfKB0XSC/ajmrkl8l34ewHZoLJN/gneaZG4tfOrnyv264NG2sVOX7C7ENVs8Xn xSwaRae4HbxGoC6ojYIHnFNhu0g5gSYeiUbXylnITej6bRbDLW1/sE3DUzSCb2zWnL1T J4ETS3kmnE3ne1ZodbTdqE4rlme5771ZqD9saWGTY9ZMq7qGUjgSYwg+3V70CDOJjxbP P3xw== X-Gm-Message-State: AOAM533vnQullWnSa8DXnFuYbXPeedZqPllv4o59wdFesJB4lIv7RGJx 3ecLVMxL7KOpEkQYQre51HpHSQokuwvgaQ== X-Google-Smtp-Source: ABdhPJwjizH6+zRcHHtgB1STDzO4Hn/ikTk+uRP3Oknl0gAtWrlaWkyMfHHKVaqA2xLHhn/DQILN1w== X-Received: by 2002:a1c:448a:: with SMTP id r132mr7799475wma.117.1630057172417; Fri, 27 Aug 2021 02:39:32 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id g1sm4654054wrb.27.2021.08.27.02.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 02:39:31 -0700 (PDT) From: zimoun To: Raghav Gururajan , guix-devel@gnu.org Subject: Re: delete-generations or --delete-generations? In-Reply-To: References: Date: Fri, 27 Aug 2021 11:27:06 +0200 Message-ID: <86v93rb5lh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: 30A1D84B8 X-Spam-Score: -4.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: uQGLk771ZdBR Hi Raghav, On Thu, 26 Aug 2021 at 21:04, Raghav Gururajan wr= ote: > Why there is no '--' prefix to 'delete-generations' for `guix system`,=20 > when there is for `guix pull` and `guix package`? I speculate too. :-) I guess because the idea behind =E2=80=9Cguix system= =E2=80=9D is one action at a time however =E2=80=9Cguix package=E2=80=9D can compose act= ions in one transaction (guix package --install=3Dfoo --remove=3Dbar). Using the default CLI parser (SRFI-37), it seems easier for composing to use the options (--) than to extract actions. For instance, if it was =E2=80=9Cguix package =E2=80=9D as it is with =E2=80=9Cguix system= =E2=80=9D, then it is harder to parse the composition, i.e., guix package install foo remove bar Aside the CLI parser is more work than just using =E2=80=99args-fold=E2=80= =99 from SRFI-37, ambiguities happen: consider the case where =E2=80=99remove=E2=80= =99 is also a package, for instance. Then the other actions (--list-generations, --show, --search, etc.) would inherit from this initial =E2=80=9Cguix package=E2=80=9D design about= composition for a install/remove transactions. Well, I agree that =E2=80=9Cguix system=E2=80=9D is inconsistent with the r= est of commands. First, =E2=80=9Cguix system=E2=80=9D does not enjoy the typo hin= ter: $ guix system delte-generations guix system: error: delte-generations: unknown action compared to: $ guix package --delte-generations guix package: error: delte-generations: unrecognized option hint: Did you mean `delete-generations'? Well, although it is obviously fixable. ;-) Second, it leads to corner cases as describe by the manual, for instance, $ guix system delete-generation -1 guix system: error: 1: unrecognized option here =E2=80=99-1=E2=80=99 is considered by the parser as a short option, so= one needs: $ guix system delete-generation -- -1 Issue which does not happen using =E2=80=9C--delete-generation=E2=80=9D. :-) On the other hand, the composition is not totally true, for instance: $ guix package --show=3Dcuirass --search=3D"GNU hello" name: hello =E2=80=A6 $ guix package --search=3D"GNU hello" --show=3Dcuirass name: cuirass =E2=80=A6 although it is debatable to compose them. :-) Ah consistent CLI, so complicated topic! ;-) Cheers, simon PS: It reminds me issues with short-name accepting optional argument: guix package -I -p /tmp/profile # fails guix package -p /tmp/profile -I # works where a next action is described here . :-)