From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePo1G-0001k3-1l for guix-patches@gnu.org; Fri, 15 Dec 2017 06:19:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePo18-0008G4-KH for guix-patches@gnu.org; Fri, 15 Dec 2017 06:19:10 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:54318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePo18-0008Fj-Fx for guix-patches@gnu.org; Fri, 15 Dec 2017 06:19:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePo18-0005hA-1t for guix-patches@gnu.org; Fri, 15 Dec 2017 06:19:02 -0500 Subject: [bug#29409] [PATCH v2 3/4] scripts: system: Add --expression option. Resent-Message-ID: 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> From: Mathieu Othacehe In-reply-to: <87vah8jmvt.fsf@gnu.org> Date: Fri, 15 Dec 2017 12:18:44 +0100 Message-ID: <87vah89r3f.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 29409@debbugs.gnu.org > What happens if we run “guix system vm”? Do we still get 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." (case action ((build container vm vm-image disk-image reconfigure) - (unless (= count 1) + (unless (or (= count 1) + (and expr (= count 0))) Thanks, Mathieu