From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YFUJFJ18xWLUmgAAbAwnHQ (envelope-from ) for ; Wed, 06 Jul 2022 14:14:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eFPfE518xWL/MgAA9RJhRA (envelope-from ) for ; Wed, 06 Jul 2022 14:14:21 +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 1E2C912538 for ; Wed, 6 Jul 2022 14:14:21 +0200 (CEST) Received: from localhost ([::1]:37870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o93vA-00043c-3e for larch@yhetil.org; Wed, 06 Jul 2022 08:14:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o93uo-00041b-UN for guix-devel@gnu.org; Wed, 06 Jul 2022 08:14:00 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:34408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o93um-0004P9-FL; Wed, 06 Jul 2022 08:13:58 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id E7CE4623F8; Wed, 6 Jul 2022 12:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=bokr.com; s=easymail; t=1657109633; bh=kNYuU/htI0qV4X6DwuFHexfaox7GLyjpMPhyGf1NQLU=; h=From:Date:To:Cc:Subject:References:In-Reply-To:From; b=giIdVlNYEhdRIt3kPDz/N3qC2meRTlV/oHKE14s1uH87chhSQjMpu/W/3BE/BJKmI V9wJpiuCggFiZTk/om2VGQWdJvr9bfYw8V5NrPrjEQw569S6YdWfeM9AYLVFPCmcMr PO8XziHOFqWg4qorRSAvyf1EBmmR5ezlaDl5ERW2vUEkfmj7ey+2Awyt8stmQIx7z7 HWu/YYpFYNVPKJMDCvJ/4X6bBmiRqFUamI+g5fA2bYOq8ebQP4lzwAMSWak19rHDdB ieYqKm0BHN8tVrcZue49/GjxDXlU8Tp4rKKa1aRX7GcGJpyrdhSZBdiPAdSWdEdhdR r4IyqIc0RzpZw== X-Virus-Scanned: Debian amavisd-new at emo07-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo07-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D8L_gaCKYg3d; Wed, 6 Jul 2022 12:13:53 +0000 (UTC) Received: from localhost (m90-129-205-176.cust.tele2.se [90.129.205.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 448786239B; Wed, 6 Jul 2022 12:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=bokr.com; s=easymail; t=1657109633; bh=kNYuU/htI0qV4X6DwuFHexfaox7GLyjpMPhyGf1NQLU=; h=From:Date:To:Cc:Subject:References:In-Reply-To:From; b=giIdVlNYEhdRIt3kPDz/N3qC2meRTlV/oHKE14s1uH87chhSQjMpu/W/3BE/BJKmI V9wJpiuCggFiZTk/om2VGQWdJvr9bfYw8V5NrPrjEQw569S6YdWfeM9AYLVFPCmcMr PO8XziHOFqWg4qorRSAvyf1EBmmR5ezlaDl5ERW2vUEkfmj7ey+2Awyt8stmQIx7z7 HWu/YYpFYNVPKJMDCvJ/4X6bBmiRqFUamI+g5fA2bYOq8ebQP4lzwAMSWak19rHDdB ieYqKm0BHN8tVrcZue49/GjxDXlU8Tp4rKKa1aRX7GcGJpyrdhSZBdiPAdSWdEdhdR r4IyqIc0RzpZw== From: bokr@bokr.com Date: Wed, 6 Jul 2022 14:13:38 +0200 To: zimoun Cc: jgart , Tobias Geerinckx-Rice , guix-devel@gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: repl macro (metacommand?) for guix CLI (sub)commands Message-ID: <20220706121338.GA16119@LionPure> References: <20220703131112.GB5967@gac> <87mtdpau7y.fsf@gnu.org> <20220704132159.GC3017@gac> <86tu7wxzpw.fsf@gmail.com> <20220705172743.GB3448@gac> <87o7y2zqnj.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87o7y2zqnj.fsf@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Received-SPF: pass client-ip=64.68.200.34; envelope-from=bokr@bokr.com; helo=mailout.easymail.ca X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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=1657109661; 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=w3Fuha7ZbDemGJ7ocQmNT2T9JQ3imwbSebMzh5/QJZ0=; b=Kd842aRiUiDwPnQFmB/YWhPrXNILPMlYOJKcUd/d4139hRK73IzZV+XXUcBGJYAyYdgCZo oHVkVIsYJ5dpyx4LCpWGlrkwqS06qNf1nKyxjdSQcEeHTAyeIRdD4nj9S+VI4eY64HGmOa zheSFxetzwCWwmtHGoJttQuC9XfpJoAPHTGh6pEffkJnXChk2L5xAdSY/niw59eAninLfx aoqY4oecGza+fOq9vOJrvMdMKYspziQWtH9/mubvN1EdQ5eLd9SLgirdSkkBhXtNYIYkc/ xvKHG+4EWIY5Ow8hfQoRNgcQrlVTQ6r8n+8t7I9PaJ8wS7aktuHEm+baX4VSqA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657109661; a=rsa-sha256; cv=none; b=ZM8xGwljCzxl4hNfdnrWNAxnyYx3VKUIhEQyQIpDHp2A+o+hOuvuCJAwpq3fL7BaIOTVmS UiSQcuadXU9skiTsyPryFxvcz+6hwGsPL4GvLMlaFLkh9v9QsW5AWC3zQZHGivs3rBzpsU RrAGtoT8J4qyzXzKFUHBqh+3XAUSlTEBovaCJDAaO45Mb3M3ufm7YUwtN0M41E/39rIgah 3C56rSmHGaGyNT4OEdTitk6e0oFYTD/mABjNFoaPgSqXNAjMkQDZCwwjkt7nCiRBpqqmYN j0kuPai49kqUAjVAcOsqI8J0oeeuXP58UqmFyEdPr22RdD6xL7F+Xp4XXJNC4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=bokr.com header.s=easymail header.b=giIdVlNY; dkim=fail ("headers rsa verify failed") header.d=bokr.com header.s=easymail header.b=giIdVlNY; dmarc=none; 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: 3.05 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=bokr.com header.s=easymail header.b=giIdVlNY; dkim=fail ("headers rsa verify failed") header.d=bokr.com header.s=easymail header.b=giIdVlNY; dmarc=none; 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: 1E2C912538 X-Spam-Score: 3.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: qraumHWdeln8 Hi, On +2022-07-06 08:44:32 +0200, zimoun wrote: > Hi, > > On mar., 05 juil. 2022 at 17:27, jgart wrote: > > > That's a good question! Maybe we should make a feature table and analyze > > what we currently have exposed to decide what we might want in the near > > future that we don't currently have. > > What is already exposed: > > --8<---------------cut here---------------start------------->8--- > $ guix repl > GNU Guile 3.0.8 > Copyright (C) 1995-2021 Free Software Foundation, Inc. > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. > > Enter `,help' for help. > scheme@(guix-user)> ,help guix > Guix Commands [abbrev]: > > ,run-in-store EXP - Run EXP through the store monad. > ,enter-store-monad - Enter a REPL for values in the store monad. > > scheme@(guix-user)> > --8<---------------cut here---------------end--------------->8--- > > And patch#56114 [1] introduce in addition: > > ,verbosity LEVEL - Change build verbosity to LEVEL. > ,lower OBJECT - Lower OBJECT into a derivation and return it. > ,build OBJECT - Lower OBJECT and build it, returning its output file name(s). > > > 1: > > > >> Is it possible to detect if an interactive call? I was thinking to add > >> a global parameter in ’(guix scripts repl) and then this new > >> ’maybe-exit’ could check it; but I guess Guile provides a better > >> mechanism for checking interactiveness. > > > > Do you know if guile provides a way of checking that? Should we ask on > > the guile mailing list or should we read more code first to see what's > > currently provided? > > I do not know about a Guile feature allowing to check the > interactiveness. It seems worth to ask on Guile mailing list because, > if such feature exists then, I have missed from the Guile manual. > > > Cheers, > simon > I think (IANA bash expert) PS1 should be a pretty good indicator, unless something funny is going on :) (Note the difference between executing and sourcing): (IDK if other shells use PS1 so it would work in such environments) I looked in man ps to see if possibly ps -o could make an easy check (seems like there ought to be, but I am out of time after almost an hour of experimenting :/ ) --8<---------------cut here---------------start------------->8--- [13:23 ~/bs]$ guile --no-auto-compile -c '(display (getenv "PS1"))(newline)' [\A \w]\$ [13:24 ~/bs]$ ./guile-non-int-call PS1_val='#f' #f [13:24 ~/bs]$ source ./guile-non-int-call PS1_val='[\A \w]\$ ' [\A \w]\$ [13:24 ~/bs]$ cat -nA ./guile-non-int-call 1 #!/usr/bin/bash$ 2 PS1_val="$(guile --no-auto-compile -c '(display (getenv "PS1"))(newline)')"$ 3 echo "PS1_val='$PS1_val'"$ 4 guile --no-auto-compile -c '(display (getenv "PS1"))(newline)'$ [13:25 ~/bs]$ --8<---------------cut here---------------end--------------->8--- HTH -- Regards Bengt Richter