unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Tom Zander <tomz@freedommail.ch>
Cc: 40549@debbugs.gnu.org
Subject: bug#40549: More usability issues:
Date: Tue, 12 May 2020 23:38:50 +0200	[thread overview]
Message-ID: <CAJ3okZ3CBnFVec601MucSY0BiVifNBPQiB_V0rca12ZhY2txUQ@mail.gmail.com> (raw)
In-Reply-To: <5565734.MhkbZ0Pkbq@cherry>

On Tue, 12 May 2020 at 22:19, Tom Zander <tomz@freedommail.ch> 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[<keyid>], --gpg-sign[=<keyid>]
> >
> > 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




  reply	other threads:[~2020-05-12 21:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11  9:23 bug#40549: [usability] revert last generation Tom Zander via Bug reports for GNU Guix
2020-04-23 19:37 ` Ludovic Courtès
2020-04-23 19:51 ` bug#40549: More usability issues: Tom via Bug reports for GNU Guix
2020-04-24  8:28   ` zimoun
2020-05-12  0:27     ` zimoun
2020-05-12  8:51       ` Ludovic Courtès
2020-05-12  9:54         ` Tom Zander via Bug reports for GNU Guix
2020-05-12 11:35           ` zimoun
2020-05-12 16:23             ` Tom Zander via Bug reports for GNU Guix
2020-05-12 18:08               ` zimoun
2020-05-12 20:19                 ` Tom Zander via Bug reports for GNU Guix
2020-05-12 21:38                   ` zimoun [this message]
2020-05-13  6:22                     ` Tom Zander via Bug reports for GNU Guix
2020-05-13 16:32                   ` Arne Babenhauserheide
2020-05-13 18:02                     ` zimoun
2020-05-13 18:53                       ` Arne Babenhauserheide
2020-05-14  9:08                         ` zimoun
2020-05-12 14:10           ` zimoun
2020-05-12 10:38         ` zimoun
2020-05-12 13:58         ` zimoun
2020-05-14  8:15     ` Efraim Flashner
2020-05-14  9:13       ` zimoun
2020-05-14 14:25       ` bug#40549: Fix -p profile -p profile -I zimoun
2020-05-12 13:03 ` bug#40549: proposal for 'process-actions' zimoun
2020-05-12 16:26   ` Tom Zander via Bug reports for GNU Guix
2021-09-08 12:49 ` bug#40549: [usability] revert last generation zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ3okZ3CBnFVec601MucSY0BiVifNBPQiB_V0rca12ZhY2txUQ@mail.gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=40549@debbugs.gnu.org \
    --cc=tomz@freedommail.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).