From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AC+DFtkvw2KFngAAbAwnHQ (envelope-from ) for ; Mon, 04 Jul 2022 20:22:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wL1mFtkvw2K9EAAAauVa8A (envelope-from ) for ; Mon, 04 Jul 2022 20:22:17 +0200 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 307F81FA8E for ; Mon, 4 Jul 2022 20:22:16 +0200 (CEST) Received: from localhost ([::1]:47816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8Qi7-0004qG-PQ for larch@yhetil.org; Mon, 04 Jul 2022 14:22:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Qhx-0004pu-ML for guix-devel@gnu.org; Mon, 04 Jul 2022 14:22:05 -0400 Received: from mx1.dismail.de ([78.46.223.134]:35679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Qhv-00048D-1I; Mon, 04 Jul 2022 14:22:05 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 7c8ebded; Mon, 4 Jul 2022 20:21:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=date :message-id:from:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s= 20190914; bh=G+ZW/dVNgV0uAGWcQ8kMN/U06dSF3ZAGCbYBTGd8pMU=; b=TJK DQNErKWjxEN4AAGQCGth0TLMuNtvr7BRIxyTCyjODL/lO1q9RWdtk3MavumZgBv2 KnHdDgOjQqr6k/6lRzR4tB6BjmLjPSu2/AVFUa/KBFLIrv3bUhrBuEohQ2ppYXHR AH36Sgm85hUJqV65rEcx+Z6GRucxRTqZSd1dFk97IpkVi8VZyaAPNkn6R067BDW6 qIjKifnS6pGrwT+KdJDjR3SOgYmSXDy32F3ojwxQmCSmDNxa2azKT65S9l+5448u csLKKeYJxMK84c+zq6jeojyNFeXRuYKuYG/yiCNRqUf2WkAwYlcEXNfKXFnyQqyf 6CFIiefMA7atoXtBH1A== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 41fc7270; Mon, 4 Jul 2022 20:21:56 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id ec3a5aaa; Mon, 4 Jul 2022 20:21:55 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 6b0adc3e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 4 Jul 2022 20:21:55 +0200 (CEST) Date: Mon, 4 Jul 2022 13:21:59 -0500 Message-ID: <20220704132159.GC3017@gac> From: jgart To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Guix Devel , zimoun Subject: Re: repl macro (metacommand?) for guix CLI (sub)commands In-Reply-To: <87mtdpau7y.fsf@gnu.org> References: <20220703131112.GB5967@gac> <87mtdpau7y.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=78.46.223.134; envelope-from=jgart@dismail.de; helo=mx1.dismail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656958937; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=G+ZW/dVNgV0uAGWcQ8kMN/U06dSF3ZAGCbYBTGd8pMU=; b=G/9pXu0IMUK0TRQ06BEECESvYSk3KefdBPWpBgxXexX6ostOTsuJ1alMb4vZ0zPZACGmbN IEfd+g86q7iRPNJvfmGLZLYe5T9mN003fBXETk8xR3DrtuUE6IPVw4JbJF+CgIREH0OSJG btmJVnAWISV1BKMw85lg++67bka1MVMnV4fgWioHKfgwy19LwKel25lGw8y4VgavaJzbnO 4gNfUtxCLGsqyrqgs7gnjSo259G69NV09LZNKDVnOlFguXET87yOSRWm1gVNbGYCKydh24 6oY+qzPfVlzLY0MlZRT1m5PFKzCbVZ70+4uc9Kt/h34sLqn5mbeyWNl2JLWwDw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656958937; a=rsa-sha256; cv=none; b=q3VJzDfvOEEguer9EqcQ2icgdPsJlYZDU/gpqipNg5UicL8WbtHSJ1CpTJeNVLgxdpv6Uc 3ib8MVZMEFi7ZGnKEbrXBX/qpzlL/mgyI5RfRqSeCuDz4tHOz2FsK0GbvzD0+adGzS8X9E DmU6QARFkbuhe33RRZFsmm2ToEtv6BwGCuaF5FPCAId9WHkitwN/wlGRJgUf79smk8ycd+ UHMqYbZwIrObgvG57ahbG72Zo0XbdIvFZpx1e2E78G+a7UNLjLIxPSenSEfBUaqIVUlVoN E/ZN7MPgxZTVkPoGm5o9NRkhjlfcTARWqtjahqAlPlT1T47p1KtNaUkf3scMlg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b="TJK DQNE"; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.75 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b="TJK DQNE"; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 307F81FA8E X-Spam-Score: -8.75 X-Migadu-Scanner: scn0.migadu.com X-TUID: Iv8pPC+HG5+a On Mon, 04 Jul 2022 15:22:09 +0200 Ludovic Courtès wrote: > In addition to what zimoun wrote, see this discussion about providing > REPL metacommands to lower or build things: Simoun, thanks for the repl session demo. I hadn't tried running the guix scripts modules at the repl yet. Ludo, thanks for the metacommand discussion link. It's much appreciated! In exploring at the repl a bit now I realized that running `(guix-package "--help")` or `(guix-package "--version")` causes the repl to exit. This is because each of those "CLI calls" end up running `(exit 0)` at the end in some form or another. Would it be desireable to write some extra code to have the `guix-*` "CLI functions" not call `(exit 0)` if in a repl and call it if using from the command line? I imagine that this is only desireable if using the command line? That way I won't be thrown out of the repl session by accident and the experience would be more like the CLI experience. I'm thinking something like a `maybe-exit` and `show-version-and-maybe-exit` function instead of `(exit 0)` and `show-version-and-exit` as currently used, respectively. I'm not sure at the moment on how to detect if I am in a repl when calling those functions or if I am calling them from the command line. What do you think? -- jgart