GNU bug report logs -
#45893
[PATCH 0/2] DRAFT: Hint for options.
Previous Next
Reported by: zimoun <zimon.toutoune <at> gmail.com>
Date: Fri, 15 Jan 2021 16:38:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Ludo,
On Tue, 19 Jan 2021 at 18:20, Ludovic Courtès <ludo <at> gnu.org> wrote:
> zimoun <zimon.toutoune <at> gmail.com> skribis:
>
> > * guix/scripts/search.scm (define-command): Replace 'args-fold*' by
> > 'parse-command-line'.
> > * guix/scripts/show.scm (define-command): Replace 'args-fold*' by
> > 'parse-command-line'.
>
> [...]
>
> > - (args-fold* args %options
> > - (lambda (opt name arg . rest)
> > - (leave (G_ "~A: unrecognized option~%") name))
> > - handle-argument
> > - '()))
> > + (parse-command-line args %options '()))
>
> In these two cases, you need to pass #:build-options? #f.
Ok. One question is: do we replace all the 'args-fold*' by
'parse-command-line' (with the correct arguments)? If yes, the
proposal works. Otherwise, the computation of the hint should be
moved to elsewhere. But where to avoid to duplicate code (replacing
args-fld* by parse-command-line in all guix/scripts/ fixes the issue).
Note that the "issue" is to handle the error. For example, if one
moves "option-hint" to "args-fold*" then the hint would not work for
all the commands.
What is your suggestion?
All the best,
simon
This bug report was last modified 4 years and 160 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.