From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ELI4GawXu17wSgAA0tVLHw (envelope-from ) for ; Tue, 12 May 2020 21:39:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uGF+NboXu16AUAAAB5/wlQ (envelope-from ) for ; Tue, 12 May 2020 21:40:10 +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 7A2E7940609 for ; Tue, 12 May 2020 21:40:08 +0000 (UTC) Received: from localhost ([::1]:42720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYcdF-0002cF-Fk for larch@yhetil.org; Tue, 12 May 2020 17:40:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYcd8-0002c7-Je for bug-guix@gnu.org; Tue, 12 May 2020 17:40:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYcd8-0002IE-AY for bug-guix@gnu.org; Tue, 12 May 2020 17:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYcd8-0002MG-8I for bug-guix@gnu.org; Tue, 12 May 2020 17:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#40549: More usability issues: Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 12 May 2020 21:40:02 +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: Tom Zander Received: via spool by 40549-submit@debbugs.gnu.org id=B40549.15893195498987 (code B ref 40549); Tue, 12 May 2020 21:40:02 +0000 Received: (at 40549) by debbugs.gnu.org; 12 May 2020 21:39:09 +0000 Received: from localhost ([127.0.0.1]:56716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYccH-0002Kt-FH for submit@debbugs.gnu.org; Tue, 12 May 2020 17:39:09 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYccF-0002Kf-Ni for 40549@debbugs.gnu.org; Tue, 12 May 2020 17:39:08 -0400 Received: by mail-qk1-f195.google.com with SMTP id b188so15277581qkd.9 for <40549@debbugs.gnu.org>; Tue, 12 May 2020 14:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8+dRCjOSwW3STRioOUX52mkxCTBqOmn7BiGvSRlmU6o=; b=cvehMKHeL/Z20M2gBpWKhCmqQo0fGUWnCRwdBrBfaN9HuFsdLguCvz9AuLsiunT21V WOt1/nWJYJ0VnSfYPvpb6XLrPhjLce1IFUcsUrUvu5Z5Yv8KhsBBzq4xtmq0L9mLBeKn dga2kYcTCufOikIEJ2S3v7nMlBCFdlubTz6cAMn3tRSs+PXHTGBmJQ4v8phSQbjNyvDz v4TuQioN1fdcbKHIMWv3uM+1iMzumFk/yGl0pcQlIQmL/tZ9Ec5i3Mn2dm6N4WZNeZeN iiNmv1/MGKwlmDA1chiZ9/uthymFHrBMvT8dQv7BKvyxcBxDhT/RNYEpmtLggAhkWILG WssQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8+dRCjOSwW3STRioOUX52mkxCTBqOmn7BiGvSRlmU6o=; b=MM2HLiGYrR8eNY8wPJqlU2vA8ccFxs343KrdXbTPNxBPfkwOInoy2R7k1A304Ezrh2 pLnOxjfNKV3Owu7QBmctEymiVYRiJlTdrLUpeGg42wh/0g4Q5SXcuazyeVvGeSewbKWJ yd3gaSsToBiTC7rxWSyQ1nGnkKqjZ7M4D+HoLhDlIyL2OyRz6rq//3SEHjk7TOXmL2J9 uQm9TJHPeDkjfIfRqqZsHWV5xLpKa7cUgjYEHy6FtAnVC+5/P/OUoycd89WDo8knuKWz q3EXgeXRQXm4JwTzOaZpBJJeLzGejurfBvTdt7uyNh0IA0WCblqmET8oHxnVAj+naM9y Q02Q== X-Gm-Message-State: AGi0PuY+e9fD3qy+C9aFywf7XtxOx1p4Vb7KGsJy6Gboz4Mbyh97KTlu Gx9SLzAFMxW6gsOzTk1X99ebir/HhMCKiPOOsRO+tc+Y X-Google-Smtp-Source: APiQypILMgOYcKhkKvvRpohqDzRJz0hIjeSqzhe/d55fS2xWi8pxcj9iOnbnWX6POTJILHpp8plOmHrloK3k4y5Q+qg= X-Received: by 2002:a37:4e05:: with SMTP id c5mr22966291qkb.232.1589319542075; Tue, 12 May 2020 14:39:02 -0700 (PDT) MIME-Version: 1.0 References: <6171889.DvuYhMxLoT@cherry> <1804825.CQOukoFCf9@cherry> <5565734.MhkbZ0Pkbq@cherry> In-Reply-To: <5565734.MhkbZ0Pkbq@cherry> From: zimoun Date: Tue, 12 May 2020 23:38:50 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" 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: , Cc: 40549@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=cvehMKHe; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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.09 / 13.00]; GENERIC_REPUTATION(0.00)[-0.53962783086416]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.06), country: US(-0.00), ip: 209.51.188.17(-0.54)]; DKIM_TRACE(0.00)[gmail.com:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[zimontoutoune@gmail.com,bug-guix-bounces@gnu.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[gnu.org:url,opengroup.org:url,freedommail.ch:email,schemers.org:url]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[40549@debbugs.gnu.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[209.51.188.17:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: 44w195opKZ7O On Tue, 12 May 2020 at 22:19, Tom Zander wrote: > They are expected to always be equivalent. It would not be logical to have the > short one as an alias if they are not equivalent. I agree. Note that you cannot have short-name with optional argument or you have to break a rule; see below. > > > You asked for an example; see `git commit -S`. From the manpage: > > > -S[], --gpg-sign[=] > > > > Thank you for the example. Let me show you that it raises an issue > > too because it is not so "simple". :-) > > Easier example then: from the 'ls(1)' manpage: > -I, --ignore=PATTERN No. `ls -I -l` is not doing the right behaviour, i.e., the flag '-l' is not applied. PATTERN is not optional. > seems git is trying to be smart. Git resolves the ambiguity by removing the form '-S keyid'. Other said, (1) '-Skeyid' uses keyid as argument (2) '-S keyid' fails as I showed you. (3) '-S' fallbacks to the default (see .gitconfig) Back to Guix, using the same strategy means: (1) guix package -d8 -p /path/to/profile (2) guix package -d 8 -p /path/to/profile # fails (3) guix pacakge -d -p /path/to/profile # delete all the generations except the current one The three cases cannot all works. You have to choose two cases. Currently Guix uses (1) and (2); and (3) fails. Git uses (1) and (3); and (2) fails. You have right by remarking that the "git-way" seems more consistent when flipping the options. However they are less consistent in regard with option requiring one argument. git commit -S4417B7 -m 'init' I do not have a strong opinion on the topic. Even if I am often annoyed by "guix package -I -p /path/to/profile". > The point is not to reinvent the wheel that have been invented so many > times... A command line parser is a known thing that you can, and should, > mirror how others do things. Are you aware of the wheel? :-) https://srfi.schemers.org/srfi-37/srfi-37.html https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html https://pubs.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap12.html#tag_12_02 > Even 'ls' uses optional short arguments (--ignore). So I'm not sure I agree > with your line of reasoning. No, the argument of '--ignore' is not optional. At least with the GNU version from coreutils 8.30. Note the options with optional argument (--color and --hyperlink) do not have a short-name form. > Doing; > ls -I -v > clearly understands that '-v' is not to be used as an optional argument. > The reason, as far as I can tell, is that it does not fit as another argument. You have wrong. Compare ls -I -l ls -l -I ls -I '' -l Because Guix uses SRFI-37 to parse command-line arguments and this will not change, IMHO, the question asked on guile-devel is the one explained above about the 3 cases. All the best, simon