From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#52999: 29.0.50; [PATCH v2] `eshell-eval-using-options' should follow POSIX/GNU argument conventions Date: Tue, 04 Jan 2022 15:01:50 +0200 Message-ID: <83k0ffbqo1.fsf@gnu.org> References: <8c7a7765-2d40-e685-1d93-c60496a4f626@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1117"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52999@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 04 14:02:28 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4jSN-000Adj-2c for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Jan 2022 14:02:28 +0100 Original-Received: from localhost ([::1]:58918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4jSK-0007cl-TT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Jan 2022 08:02:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4jRy-0007bv-Gi for bug-gnu-emacs@gnu.org; Tue, 04 Jan 2022 08:02:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4jRy-0003WA-6M for bug-gnu-emacs@gnu.org; Tue, 04 Jan 2022 08:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n4jRy-0000Kk-51 for bug-gnu-emacs@gnu.org; Tue, 04 Jan 2022 08:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jan 2022 13:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52999 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52999-submit@debbugs.gnu.org id=B52999.16413013161271 (code B ref 52999); Tue, 04 Jan 2022 13:02:02 +0000 Original-Received: (at 52999) by debbugs.gnu.org; 4 Jan 2022 13:01:56 +0000 Original-Received: from localhost ([127.0.0.1]:37111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4jRs-0000KR-4j for submit@debbugs.gnu.org; Tue, 04 Jan 2022 08:01:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4jRn-0000K6-Uc for 52999@debbugs.gnu.org; Tue, 04 Jan 2022 08:01:54 -0500 Original-Received: from [2001:470:142:3::e] (port=44836 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4jRi-0003NR-Bq; Tue, 04 Jan 2022 08:01:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7ZNVw+jr1qmztqpB66Z0rN3JzJTzpeVUXT/MpX4eDiY=; b=eY/ZBTtZlf8d MKQM+XE6tswHtjMFiQ6ElDUvZ5O11PcWID41GJomNPKb1iYX2HSB3oxVeSADPeJapx3kmbPtYxVMB +WOF1f4ZpoN1WjEs9Nl+R/PAV0xtPzc9f2eoiKqRC7JAxjF2Ir1x3KtBQR3giCr8QnuMUIJn3hXhb YfZxbrGYYZAjU4z84eDgSAEPrd6F9EIvn4p4/SdaqnBHPiCzSnFMdFlkh0sDBTftB7Fqxae1EEpP9 6hznpStIEBgyw/XTJID0khKvlgky0ULbCksIDqKRWVtISjhNui6KxWU6L3xEy9yN9D7LO6wfa9wHy cCMRMp+lXbv56WUHimJrgw==; Original-Received: from [87.69.77.57] (port=3828 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4jRg-0008Uk-5z; Tue, 04 Jan 2022 08:01:46 -0500 In-Reply-To: <8c7a7765-2d40-e685-1d93-c60496a4f626@gmail.com> (message from Jim Porter on Mon, 3 Jan 2022 21:33:28 -0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223641 Archived-At: > From: Jim Porter > Date: Mon, 3 Jan 2022 21:33:28 -0800 > > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1060,6 +1060,9 @@ dimensions. > Specifying a cons as the from argument allows to start measuring text > from a specified amount of pixels above or below a position. > > +--- > +** 'eshell-eval-using-options' now follows POSIX/GNU argument syntax conventions. This is too terse: we cannot assume that everyone knows what does "POSIX/GNU argument syntax conventions" stand for. Especially since you didn't even say "command-line arguments", just "arguments". Please make the entry more informative. And why don't people who propose and install changes in Eshell also update the Eshell manual? That the manual in its current shape leaves a lot to be desired is not a justification to leave it that way. We will never improve that manual unless we start adding useful stuff to it, one small piece at a time. > (ert-deftest test-eshell-eval-using-options () > "Tests for `eshell-eval-using-options'." > + ;; Test short options. > (eshell-eval-using-options > - "sudo" '("-u" "root" "whoami") > - '((?u "user" t user "execute a command as another USER") > - :parse-leading-options-only) > - (should (equal user "root"))) > + "ls" '("-a" "/dev/null") > + '((?a "all" nil show-all > + "do not ignore entries starting with .")) > + (should (eq show-all t)) > + (should (equal args '("/dev/null")))) Can these tests be made less platform-specific? For example, not all the supported platforms have /dev/null, and we have a portable abstraction for it. > + "sudo" '("-u" "root" "whoami") > + '((?u "user" t user "execute a command as another USER") > + :parse-leading-options-only) > + (should (equal user "root")) > + (should (equal args '("whoami")))) > + (eshell-eval-using-options > + "sudo" '("--user" "root" "whoami") > + '((?u "user" t user "execute a command as another USER") > + :parse-leading-options-only) > + (should (equal user "root")) > + (should (equal args '("whoami")))) > + (eshell-eval-using-options > + "sudo" '("emerge" "-uDN" "world") > + '((?u "user" t user "execute a command as another USER")) > + (should (equal user "DN")) > + (should (equal args '("emerge" "world")))) > + (eshell-eval-using-options > + "sudo" '("emerge" "-uDN" "world") > + '((?u "user" t user "execute a command as another USER") > + :parse-leading-options-only) > + (should (eq user nil)) > + (should (equal args '("emerge" "-uDN" "world"))))) And here, sudo and whoami don't necessarily exist, so something should be done about that, I think. Thanks.