all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#56089] [PATCH] refresh: Repurpose '-L' for '--load-path'.
@ 2022-06-19 13:33 Ludovic Courtès
  2022-06-19 14:41 ` Tobias Geerinckx-Rice via Guix-patches via
  2022-06-19 14:49 ` Maxime Devos
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2022-06-19 13:33 UTC (permalink / raw)
  To: 56089; +Cc: Ludovic Courtès

This incompatible change fixes an inconsistency with other commands
where '-L' is short for '--load-path'.

* guix/scripts/refresh.scm (%options): Add --load-path option from
%STANDARD-BUILD-OPTIONS.  Remove #\L shortcut for --list-updaters, and
remove --load-path option that lacked the #\L shortcut.
(show-help): Update accordingly.
* doc/guix.texi (Invoking guix refresh): Update accordingly.
---
 doc/guix.texi            |  2 +-
 guix/scripts/refresh.scm | 22 ++++++----------------
 2 files changed, 7 insertions(+), 17 deletions(-)

Hi!

This patch fixes a CLI inconsistency.  It introduces an incompatibility,
but one that's probably acceptable: '--list-updaters' is rarely used.

Commit 21f4fbdd8453e489fb89825c4226a0a0bda2bc17 purposefully
introduced '--load-path' without the '-L' shorthand; in hindsight,
reclaiming '-L' for '--load-path' sounds preferable to me.

Objections?

Ludo'.

diff --git a/doc/guix.texi b/doc/guix.texi
index 86348fc02c..43b550311d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13715,7 +13715,6 @@ gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to 11
 @end example
 
 @item --list-updaters
-@itemx -L
 List available updaters and exit (see @option{--type} above).
 
 For each updater, display the fraction of packages it covers; at the
@@ -13846,6 +13845,7 @@ the user whether to download it or not.  This is the default behavior.
 Use @var{host} as the OpenPGP key server when importing a public key.
 
 @item --load-path=@var{directory}
+@itemx -L @var{directory}
 Add @var{directory} to the front of the package module search path
 (@pxref{Package Modules}).
 
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 4d52200b84..14329751f8 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -81,7 +81,10 @@ (define %options
                          (names (map string->symbol
                                      (string-tokenize arg not-comma))))
                     (alist-cons 'updaters names result))))
-        (option '(#\L "list-updaters") #f #f
+        (find (lambda (option)
+                (member "load-path" (option-names option)))
+              %standard-build-options)
+        (option '("list-updaters") #f #f
                 (lambda args
                   (list-updaters-and-exit)))
         (option '(#\m "manifest") #t #f
@@ -119,19 +122,6 @@ (define %options
                      (leave (G_ "unsupported policy: ~a~%")
                             arg)))))
 
-        ;; The short option -L is already used by --list-updaters, therefore
-        ;; it needs to be removed from %standard-build-options.
-        (let ((load-path-option (find (lambda (option)
-                                         (member "load-path"
-                                                 (option-names option)))
-                                       %standard-build-options)))
-          (option
-           (filter (lambda (name) (not (equal? #\L name)))
-                   (option-names load-path-option))
-           (option-required-arg? load-path-option)
-           (option-optional-arg? load-path-option)
-           (option-processor     load-path-option)))
-
         (option '(#\h "help") #f #f
                 (lambda args
                   (show-help)
@@ -160,7 +150,7 @@ (define (show-help)
   -t, --type=UPDATER,... restrict to updates from the specified updaters
                          (e.g., 'gnu')"))
   (display (G_ "
-  -L, --list-updaters    list available updaters and exit"))
+      --list-updaters    list available updaters and exit"))
   (display (G_ "
   -l, --list-dependent   list top-level dependent packages that would need to
                          be rebuilt as a result of upgrading PACKAGE..."))
@@ -182,7 +172,7 @@ (define (show-help)
                          used when 'key-download' is not specified"))
   (newline)
   (display (G_ "
-      --load-path=DIR    prepend DIR to the package module search path"))
+  -L, --load-path=DIR    prepend DIR to the package module search path"))
   (newline)
   (display (G_ "
   -h, --help             display this help and exit"))

base-commit: 7f208f68dea828fe02718ca8ce81d5975136cff8
-- 
2.36.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#56089] [PATCH] refresh: Repurpose '-L' for '--load-path'.
  2022-06-19 13:33 [bug#56089] [PATCH] refresh: Repurpose '-L' for '--load-path' Ludovic Courtès
@ 2022-06-19 14:41 ` Tobias Geerinckx-Rice via Guix-patches via
  2022-06-19 14:49 ` Maxime Devos
  1 sibling, 0 replies; 6+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2022-06-19 14:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 56089

[-- Attachment #1: Type: text/plain, Size: 441 bytes --]

Ludovic Courtès 写道:
> Objections?

Absolutely not.  I can't imagine anyone using ‘guix refresh 
--list-updaters’ in scripts.

If somebody (=again, not me) does object (=a thing I definitely 
will not be doing), I'd still make the change but special-case an 
‘-L’ as the last argument as a deprecated alias for 
‘--list-updaters’.   With a big fat warning that it will stop 
working one day.

Thanks!

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#56089] [PATCH] refresh: Repurpose '-L' for '--load-path'.
  2022-06-19 13:33 [bug#56089] [PATCH] refresh: Repurpose '-L' for '--load-path' Ludovic Courtès
  2022-06-19 14:41 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2022-06-19 14:49 ` Maxime Devos
  2022-06-20  7:32   ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Maxime Devos @ 2022-06-19 14:49 UTC (permalink / raw)
  To: Ludovic Courtès, 56089

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

Ludovic Courtès schreef op zo 19-06-2022 om 15:33 [+0200]:
> This incompatible change fixes an inconsistency with other commands
> where '-L' is short for '--load-path'.

Seems nice, but because it's an incompatible change, maybe a short
channel news entry would be good?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#56089] [PATCH] refresh: Repurpose '-L' for '--load-path'.
  2022-06-19 14:49 ` Maxime Devos
@ 2022-06-20  7:32   ` Ludovic Courtès
  2022-06-20 11:04     ` Efraim Flashner
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2022-06-20  7:32 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 56089

Maxime Devos <maximedevos@telenet.be> skribis:

> Ludovic Courtès schreef op zo 19-06-2022 om 15:33 [+0200]:
>> This incompatible change fixes an inconsistency with other commands
>> where '-L' is short for '--load-path'.
>
> Seems nice, but because it's an incompatible change, maybe a short
> channel news entry would be good?

Since this is very much an edge case, I’m not sure it’s worth it, but no
strong opinion.  Thoughts?

Ludo’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#56089] [PATCH] refresh: Repurpose '-L' for '--load-path'.
  2022-06-20  7:32   ` Ludovic Courtès
@ 2022-06-20 11:04     ` Efraim Flashner
  2022-06-22 21:50       ` bug#56089: " Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Efraim Flashner @ 2022-06-20 11:04 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Maxime Devos, 56089

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]

On Mon, Jun 20, 2022 at 09:32:43AM +0200, Ludovic Courtès wrote:
> Maxime Devos <maximedevos@telenet.be> skribis:
> 
> > Ludovic Courtès schreef op zo 19-06-2022 om 15:33 [+0200]:
> >> This incompatible change fixes an inconsistency with other commands
> >> where '-L' is short for '--load-path'.
> >
> > Seems nice, but because it's an incompatible change, maybe a short
> > channel news entry would be good?
> 
> Since this is very much an edge case, I’m not sure it’s worth it, but no
> strong opinion.  Thoughts?

I think a news entry would be good.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#56089: [PATCH] refresh: Repurpose '-L' for '--load-path'.
  2022-06-20 11:04     ` Efraim Flashner
@ 2022-06-22 21:50       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2022-06-22 21:50 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: Maxime Devos, 56089-done

Pushed!

  2873433c72 news: Add entry for 'guix refresh -L' change.
  bdf4221767 refresh: Repurpose '-L' for '--load-path'.

Ludo’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-22 21:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-19 13:33 [bug#56089] [PATCH] refresh: Repurpose '-L' for '--load-path' Ludovic Courtès
2022-06-19 14:41 ` Tobias Geerinckx-Rice via Guix-patches via
2022-06-19 14:49 ` Maxime Devos
2022-06-20  7:32   ` Ludovic Courtès
2022-06-20 11:04     ` Efraim Flashner
2022-06-22 21:50       ` bug#56089: " Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.