From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IaMSNJ3Nul4lbAAA0tVLHw (envelope-from ) for ; Tue, 12 May 2020 16:23:57 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id +GcED6zNul4QdgAA1q6Kng (envelope-from ) for ; Tue, 12 May 2020 16:24:12 +0000 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 95F13940D36 for ; Tue, 12 May 2020 16:24:09 +0000 (UTC) Received: from localhost ([::1]:43548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYXhS-0000Ts-Iu for larch@yhetil.org; Tue, 12 May 2020 12:24:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYXhK-0000Tc-7e for bug-guix@gnu.org; Tue, 12 May 2020 12:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYXhJ-0002pw-Uy for bug-guix@gnu.org; Tue, 12 May 2020 12:24:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYXhJ-0006fr-QW for bug-guix@gnu.org; Tue, 12 May 2020 12:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#40549: More usability issues: Resent-From: Tom Zander Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 12 May 2020 16:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40549 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: zimoun Cc: 40549@debbugs.gnu.org Received: via spool by 40549-submit@debbugs.gnu.org id=B40549.158930060625600 (code B ref 40549); Tue, 12 May 2020 16:24:01 +0000 Received: (at 40549) by debbugs.gnu.org; 12 May 2020 16:23:26 +0000 Received: from localhost ([127.0.0.1]:56392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYXgj-0006eq-Lu for submit@debbugs.gnu.org; Tue, 12 May 2020 12:23:25 -0400 Received: from mx.kolabnow.com ([95.128.36.40]:32554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYXgh-0006eZ-K9 for 40549@debbugs.gnu.org; Tue, 12 May 2020 12:23:25 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 62B8840788; Tue, 12 May 2020 18:23:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freedommail.ch; h=content-type:content-type:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:date :subject:subject:from:from:received:received:received; s= dkim20160331; t=1589300595; x=1591114996; bh=NDY7VFbqFLuQjJaaRA/ pE5vMABTmYa1/KMDUkEVC7Uk=; b=IFLuAVGE0FK+1/ByykioEOaCOYKYd26LNEn zTChAUn6a/CIKAfKjaX9aCPUs9r7LXg24bDLGdOWJXDMvpMIBeIx1gnwFxb6D5+f 7hH4GOsAPrboXhC7qO63K9lGiuvl7Jg3hv6mbQ4eoYWBKBxWk/G2hUOK9C/Ubejh 34wATDnjQVQjwDI48Ud9Ztx5WFdQpkuWq8Xy8mocndZu37DIGAYvYzD4soNntn82 6PzIyfSy2WtjntZwDMFfVwcaw8uJKuseRDaxbiS3UR0da8z4vj7tUJ9ANvJFdS3H 6upcbuSSt/PUf4cDYDz6ZTwogvHUfanMUZ/3e/oDVnhcN4ZUfvqUDQfdxSBU9A0F nURvdbj+lX/poi4GKQe8UBB5BthcxJPFjqayS/DWLJJcLXxF/IaWgRSm6D3iutSP QmAYvc+fRbpa0b2kM1IeMrc2tkkOSiRZo+eCrQOl5kXz3/o/2Sk4kFJLJxLxsCRV 0hQcUwbxNcfIkFacUOqf6y7qVmphWOsJG5BSpw6MhEIi08OAwcRPMY0sjn9EccRY M+lpXAIf6mLbUIHFEDn4cTcQNrZM23EsDF/lAUST1A9pC3PU8PbhgUNn+VrvppiL 13zUY05pftzamIJ9ogoapUGjVvpBnvDZIo4TMqBYRrcja+rM10pdjKZkjMUcJl5p QvTnBJNU= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Score: -1.899 Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A6TLwrCPSl2N; Tue, 12 May 2020 18:23:15 +0200 (CEST) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id BAE6A40589; Tue, 12 May 2020 18:23:15 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 6880E2366; Tue, 12 May 2020 18:23:15 +0200 (CEST) Date: Tue, 12 May 2020 18:23:13 +0200 Message-ID: <1804825.CQOukoFCf9@cherry> In-Reply-To: References: <6171889.DvuYhMxLoT@cherry> <5652466.lOV4Wx5bFT@cherry> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Tom Zander From: Tom Zander via Bug reports for GNU Guix X-Scanner: scn0 X-Spam-Score: 0.99 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=freedommail.ch header.s=dkim20160331 header.b=IFLuAVGE; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Scan-Result: default: False [0.99 / 13.00]; HAS_REPLYTO(0.00)[tomz@freedommail.ch]; GENERIC_REPUTATION(0.00)[-0.5399275979227]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.06), country: US(-0.00), ip: 209.51.188.17(-0.54)]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; R_DKIM_REJECT(1.00)[freedommail.ch:s=dkim20160331]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[freedommail.ch:-]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; CTE_CASE(0.50)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; FROM_NEQ_ENVFROM(0.00)[bug-guix@gnu.org,bug-guix-bounces@gnu.org]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[gnu.org:email]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TAGGED_RCPT(0.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[209.51.188.17:from]; DMARC_NA(0.00)[gnu.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_SEVEN(0.00)[11]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: 90fNr8ZPw/Sh On dinsdag 12 mei 2020 13:35:04 CEST zimoun wrote: > On Tue, 12 May 2020 at 11:55, Tom Zander via Bug reports for GNU Guix > > wrote: > > the bugreport is a usability bug which stems from the fact that the > > command > > line parser behaves differently from every single other commandline parser > > average people like me have ever used. > > > > A near 100% of the command line tools on your Gnu/Linux box will behave > > differently than guix does now. > > > > C apps using libc, python apps using their parser, even C++ apps using the > > Qt commandline classes, all are generally compatible with regards to > > behavior. > > > > Only Guix is different. > > Could you provide concrete examples? Other than "guix package"? > And other than short-option with optional argument? This report lists two items. Indeed the short options are a good one. It is unheard of to have an alias not be an alias but behave differently. It also can't be said to be documented as the --help output does not actually state this. I only learned this difference today :-) The other is the ordering of arguments being parsed unpredictable. The usecase given was the `-d 1 -S 2` arguments (see earlier emails for details). > Please could you indicate me command-line tools where short-option > with optional-argument is possible. > Because if there is one, I could have inspiration to know how it > resolves the ambiguity. The design of the short options is that it is an alias. Identical to the software regardless of what the user typed. So you get 'cut --field 1' or 'cut -f1' or 'cut -f 1' or 'cut -f=1'. All identical. The important part here is that each _option_ is written separately, with a leading dash. When you talk about flags you can group them. `mv -vufi` is again identical to `mv -v -u -f -i`. But this is irrelevant to your question because, as stated, this is about _flags_, not option. You asked for an example; see `git commit -S`. From the manpage: -S[], --gpg-sign[=] > The issue is that Guix uses a bad practise: option with optional-argument > with both short and long name. It is a mistake to provide the short-name > for such case. It looks like the parser could be improved by preferring to see any argument with leading dash as a option when it **might** be an argument. So; if you type -`guix package -l --help` then your parser **first** finds all the items with leading dashes and second it tries to find out if there is an argument for the `-l`. In this case I expect the help to be shown. This is widely seen as a solution. Users can still use items with leading dashes by using two commonly used tricks. The -l=a type of construction allows the argument to be anything. Including it having a leading dash. Second is the double-dash argument that stops words leading with dashes being parsed as options. For instance; grep -- -v * the -v is parsed as an actual string and not an option because it follows the double dashes. > Now all this is clearer for me and I do not think it is a fixable bug. It is, just follow the suggestion from me and from zimoun: any command-line- argument that starts with a dash should be preferred to be an option. Only in a second phase do you try to match anything to (optional) options. As stated, the rest of the world does this, please check out the various examples I gave here to confirm that others have solved it and it may be possible to solve it for guix too. -- Tom Zander