From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id QPp3L/EpNWfhCgAAqHPOHw:P1 (envelope-from ) for ; Wed, 13 Nov 2024 22:36:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id QPp3L/EpNWfhCgAAqHPOHw (envelope-from ) for ; Wed, 13 Nov 2024 23:36:33 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kolabnow.com header.s=dkim20240523 header.b=eZyJwpGQ; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731537393; a=rsa-sha256; cv=none; b=OZCW+ZMEFXzAW3UxEJhgW1iJb+RegBAkAo6cHzyukmKTYAckvWfe11icVYR4vRDcVbHzcE 19S8yK9Y/60+FyR0btah5WTuiKX7xl7pQ4mAaFkF9S3Yp3/SB4sAkmx8/A37CR3nbSRelK GHZsm1hjLfLiqEZsc3GeOQoo8RY+gyOCueULi7T3etbDv/xFGxaTcXbmJKj5V5GZFx4CqX MrNpiiepASPFy9nqL4QU8mENNm16dFE322b/magK7VL1roEO0Hw1lxz5xMixLbrA8QdPwr W3hRoQmwJvqeis1ypQ+GHydkO6Gh6dL1DbKz0m8Pm7zOMp2k9l4FjteYsBWkrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kolabnow.com header.s=dkim20240523 header.b=eZyJwpGQ; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731537393; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=c96QYoTzNfsqzEcr6e5mHOEEue/rQEyKlPum6BCH7RY=; b=V9vV4gPkpgMJFgH2IwJDQir8lduD8Iu8aPoleaBpaCrw4URfx57eQFT5/CTK7auiJlQq1S P4ysPVc7sbGj3uE6BOmUSvGKh+LQZ3DuM5n9qM1j1YQuuKkxgcxN8B3omWKB5yPMuDtV7c PQvI/5SleHI0NayhGC/eIZxrbt6V4AWiFIa2DnUM5BZFrztj6xZbN2PEeVRqdx9cz0QJs5 PYpZqHmd0ciy6ghNb6rNigPYBV64JQuF+aqkZzY0q7cLiKt3pc5V28jvKMytv3pHVgVJgJ BQnwT9TKWG8xP5K4doICMgCvHR6gw7Wcu5Aei9113ieha8SOwcrPmrGV0xOGsg== 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 6842B1AE4D for ; Wed, 13 Nov 2024 23:36:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBLy4-0005qP-Q6; Wed, 13 Nov 2024 17:36:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBLy2-0005pg-US for guix-devel@gnu.org; Wed, 13 Nov 2024 17:36:06 -0500 Received: from mx.kolabnow.com ([212.103.80.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBLxz-0006aw-DL for guix-devel@gnu.org; Wed, 13 Nov 2024 17:36:06 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 5D2E431972B7; Wed, 13 Nov 2024 23:35:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:mime-version:message-id:date:date :references:in-reply-to:subject:subject:from:from:received :received:received; s=dkim20240523; t=1731537350; x=1733351751; bh=c96QYoTzNfsqzEcr6e5mHOEEue/rQEyKlPum6BCH7RY=; b=eZyJwpGQXA/P l4DrY6gqlar4Pgk5IK2ZkaNkJn23odKNda1MOphhInH4nmI/FK7+2v4fnBu+JGac bYzQfmfAJ2LyICuRkT7yJNem6FWhAoBPol/dz9bdvd1TvCYmXki9bV7BOQybHupK mdjHbx6HgWW/yi1lwtjxUk+Lsa9U+/j8K3zxAdk0YqNgLoiE/ZM2dAdNdUWmpjdL ExDk8USbHxgD3QdSmnUeuI8Y9eptBHYFMzGqEE1wyV6AIvSdp5dT+xd7+BA/Y2Y9 nqHiD3L1tmuqH4FdkLOISheEsAVaTwSOOcHMue8Db+ZNtGACwy/o4Km9Fz8jxAAE xCeEHkK81g== X-Virus-Scanned: amavis at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id 51ZMlBt_Eppu; Wed, 13 Nov 2024 23:35:50 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id AE57D31972B6; Wed, 13 Nov 2024 23:35:47 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id D662820D16AE; Wed, 13 Nov 2024 23:35:46 +0100 (CET) From: Christopher Howard To: Ricardo Wurmus Cc: Luis Felipe , guix-devel@gnu.org Subject: Re: Unhelpful "--help" output In-Reply-To: <87ttcbc828.fsf@elephly.net> (Ricardo Wurmus's message of "Wed, 13 Nov 2024 19:17:19 +0100") References: <87o72kqv40.fsf@librehacker.com> <87ttcbc828.fsf@elephly.net> Date: Wed, 13 Nov 2024 13:35:43 -0900 Message-ID: <87frnuwym8.fsf@librehacker.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: none client-ip=212.103.80.155; envelope-from=christopher@librehacker.com; helo=mx.kolabnow.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.17 X-Spam-Score: -5.17 X-Migadu-Queue-Id: 6842B1AE4D X-Migadu-Scanner: mx10.migadu.com X-TUID: 3rRo4Idx9j5P Ricardo Wurmus writes: >> I'm trying to >> fix the bitrot in the emacs-guix "shell commands" code, which actually >> parses the --help output using regexs, and and generates magit-popup >> menus based on that. So little things like the number of spaces on the >> line before the command name actually matter. > > Perhaps emacs-guix could instead fetch the list of items as an > S-expression. You mean through guix guile API, or...? As far as the help output, emacs-guix only knows if something is a "main command", as opposed to a description of the command grouping, or other help text, based on the number of spaces preceding it, which currently is 4 spaces. For options and switches, it can look for the "-" or "--". The emacs-guix "shell command" functionality is essentially this engine that takes the perhaps dubious, but mostly effective, approach of automatically parsing all "help" and "--help" output to make it possible to manage all commands through an automatically generated magit-popup interface. The switch and option regexs are not dependent an any exact amount of whitespace, so I think that part of it is resilient enough. But the regex for the main commands are dependent on the number of spaces before the start of the command name, in the command description line. So at least those number of spaces need to remain consistent, for the "shell command" functionality to work as it is currently coded. -- Christopher Howard