[PATCH] scripts: home: Wire and document --expression flag.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Pierre Langlois
Owner
unassigned
Submitted by
Pierre Langlois
Severity
normal

Debbugs page

Pierre Langlois wrote 3 years ago
(address . guix-patches@gnu.org)
87y27gl4is.fsf@gmx.com
Hi Guix!

While testing out the new `guix home' command (congrats on merging it
btw!), I noticed the --expression flag was supported but not exposed. So
here's a patch :-).

OK to commit?

Thanks,
Pierre
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmFTltsYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31U+AAIAJCk5ILLGIv/MKOKInYKvJf7
X6xsehvxls8R9mjpj5gJ/qyRtpmXq49CRfuj0kEIVKoh0GFaXJRKChS4IHjA3F1b
bINBxBxsNqJE4L+irdye0fr7JVZquQJebILZVp/fJUBUntGnk2VwPQ2GZqfHJ/sP
l8a4m/9r1v+dFJfMOyQJ4f/jwscwCmxT/w39RlZV02nAg53Bz7ymKRxryK6xIx4D
jcT0i5sSXYJCoFLpr2NAiPnPQ0GXZ30PWj4fsIz1mIGvN9PYrt54ITyj9xor0T7l
KtJPLgOxZdRnNbTex9I3hn5E8tC+nxl21u+IH+fCuxEnxE38YxMYYqgQ/Sbs/8Q=
=CAiA
-----END PGP SIGNATURE-----

From b40cab7892939f10cf366ee08b8a045a38e1fe78 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Tue, 28 Sep 2021 22:50:39 +0100
Subject: [PATCH] scripts: home: Wire and document --expression flag.

* guix/scripts/home.scm (show-help): Add --expression option.
(%options): Likewise.
* doc/guix.texi (Invoking guix home): Document it.
---
doc/guix.texi | 16 +++++++++++++++-
guix/scripts/home.scm | 7 +++++++
2 files changed, 22 insertions(+), 1 deletion(-)

Toggle diff (68 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 3124ed2ef8..05d0d92b90 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -79,7 +79,7 @@ Copyright @copyright{} 2020 Jack Hill@*
Copyright @copyright{} 2020 Naga Malleswari@*
Copyright @copyright{} 2020, 2021 Brice Waegeneire@*
Copyright @copyright{} 2020 R Veera Kumar@*
-Copyright @copyright{} 2020 Pierre Langlois@*
+Copyright @copyright{} 2020, 2021 Pierre Langlois@*
Copyright @copyright{} 2020 pinoaffe@*
Copyright @copyright{} 2020 André Batista@*
Copyright @copyright{} 2020, 2021 Alexandru-Sergiu Marton@*
@@ -36090,6 +36090,20 @@ $ guix home list-generations 10d
@end table
+@var{options} can contain any of the common build options (@pxref{Common
+Build Options}). In addition, @var{options} can contain one of the
+following:
+
+@table @option
+
+@item --expression=@var{expr}
+@itemx -e @var{expr}
+Consider the home-environment @var{expr} evaluates to.
+This is an alternative to specifying a file which evaluates to a home
+environment.
+
+@end table
+
@node Documentation
@chapter Documentation
diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm
index 75df6d707d..a466f3deb1 100644
--- a/guix/scripts/home.scm
+++ b/guix/scripts/home.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Andrew Tropin <andrew@trop.in>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -86,6 +87,9 @@ Some ACTIONS support additional ARGS.\n"))
(show-build-options-help)
(display (G_ "
+ -e, --expression=EXPR consider the home-environment EXPR evaluates to
+ instead of reading FILE, when applicable"))
+ (display (G_ "
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
(newline)
(display (G_ "
@@ -115,6 +119,9 @@ Some ACTIONS support additional ARGS.\n"))
(let ((level (string->number* arg)))
(alist-cons 'verbosity level
(alist-delete 'verbosity result)))))
+ (option '(#\e "expression") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'expression arg result)))
%standard-build-options))
(define %default-options
--
2.33.0
Ludovic Courtès wrote 3 years ago
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)(address . 50879@debbugs.gnu.org)
878rzbwj9o.fsf@gnu.org
Hi,

Pierre Langlois <pierre.langlois@gmx.com> skribis:

Toggle quote (9 lines)
>>From b40cab7892939f10cf366ee08b8a045a38e1fe78 Mon Sep 17 00:00:00 2001
> From: Pierre Langlois <pierre.langlois@gmx.com>
> Date: Tue, 28 Sep 2021 22:50:39 +0100
> Subject: [PATCH] scripts: home: Wire and document --expression flag.
>
> * guix/scripts/home.scm (show-help): Add --expression option.
> (%options): Likewise.
> * doc/guix.texi (Invoking guix home): Document it.

LGTM, thanks! :-)

Ludo’.
Pierre Langlois wrote 3 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)
87lf3b6un7.fsf@gmx.com
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (15 lines)
> Hi,
>
> Pierre Langlois <pierre.langlois@gmx.com> skribis:
>
>>>From b40cab7892939f10cf366ee08b8a045a38e1fe78 Mon Sep 17 00:00:00 2001
>> From: Pierre Langlois <pierre.langlois@gmx.com>
>> Date: Tue, 28 Sep 2021 22:50:39 +0100
>> Subject: [PATCH] scripts: home: Wire and document --expression flag.
>>
>> * guix/scripts/home.scm (show-help): Add --expression option.
>> (%options): Likewise.
>> * doc/guix.texi (Invoking guix home): Document it.
>
> LGTM, thanks! :-)

Thanks for taking look :-). Pushed with
20bc9ecc204a610a0d5fa8b88c74421f57dbaf3b.

Pierre
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmFYwFwYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UXbQIAJIPk8XQVYhpFAFI/axUw+ys
AF3P8AWrPqrsDpfTD5EOJvrC2lsw0dRIZ2wpa9jVqXZIC4sQg+HaHxSkNEb+Jtue
EVMR1/KkdllK2XNAH6rlGk2+Vc5J6i0sBnga/QWzjn2zRUYQgtRgMlri9fnMnQ2P
+fSA2RMypTxMyXUpjza1QnvzhwlScOid6WXORgRH3oGCUeO9wdTaV80968xUu+Wr
t2iVL8fWRSvUckdKEQaA9EqbpmpEK6+koeZqynntvtZ2oL4x50R5rrky0mPf8RJP
X23QP1Nig8f/xNxEQ4L9YhjVgZYEkv38utoiq7R5/kpiGQ9rLwfn5LwsTDBHIo0=
=cgi8
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 50879@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 50879
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help