From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePqas-0007xH-Fk for guix-patches@gnu.org; Fri, 15 Dec 2017 09:04:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePqao-0004YU-ME for guix-patches@gnu.org; Fri, 15 Dec 2017 09:04:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:54396) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePqao-0004Y2-J8 for guix-patches@gnu.org; Fri, 15 Dec 2017 09:04:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePqao-0004xN-1e for guix-patches@gnu.org; Fri, 15 Dec 2017 09:04:02 -0500 Subject: [bug#29409] [PATCH v2 3/4] scripts: system: Add --expression option. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <1513162937-13145-1-git-send-email-m.othacehe@gmail.com> <1513162937-13145-3-git-send-email-m.othacehe@gmail.com> <87vah8jmvt.fsf@gnu.org> <87vah89r3f.fsf@gmail.com> Date: Fri, 15 Dec 2017 15:03:11 +0100 In-Reply-To: <87vah89r3f.fsf@gmail.com> (Mathieu Othacehe's message of "Fri, 15 Dec 2017 12:18:44 +0100") Message-ID: <87r2rwhyw0.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Mathieu Othacehe Cc: 29409@debbugs.gnu.org Mathieu Othacehe skribis: >> What happens if we run =E2=80=9Cguix system vm=E2=80=9D? Do we still ge= t a proper >> error? > > Nope, it's a mistake, would this be better ? > > @@ -1079,7 +1093,8 @@ argument list and OPTS is the option alist." > ;; Extract the plain arguments from OPTS. > (let* ((args (reverse (filter-map (match-pair 'argument) opts))) > (count (length args)) > - (action (assoc-ref opts 'action))) > + (action (assoc-ref opts 'action)) > + (expr (assoc-ref opts 'expression))) > (define (fail) > (leave (G_ "wrong number of arguments for action '~a'~%") > action)) > @@ -1093,7 +1108,8 @@ argument list and OPTS is the option alist." >=20=20 > (case action > ((build container vm vm-image disk-image reconfigure) > - (unless (=3D count 1) > + (unless (or (=3D count 1) > + (and expr (=3D count 0))) It looks better, yes. Thanks! Ludo=E2=80=99.