unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre Langlois <pierre.langlois@gmx.com>
To: 50879@debbugs.gnu.org
Subject: [bug#50879] [PATCH] scripts: home: Wire and document --expression flag.
Date: Tue, 28 Sep 2021 23:06:06 +0100	[thread overview]
Message-ID: <87y27gl4is.fsf@gmx.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 205 bytes --]

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


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

[-- Attachment #2: 0001-scripts-home-Wire-and-document-expression-flag.patch --]
[-- Type: text/x-patch, Size: 2932 bytes --]

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(-)

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


             reply	other threads:[~2021-09-28 22:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 22:06 Pierre Langlois [this message]
2021-10-02 15:14 ` [bug#50879] [PATCH] scripts: home: Wire and document --expression flag Ludovic Courtès
2021-10-02 20:25   ` bug#50879: " Pierre Langlois

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=87y27gl4is.fsf@gmx.com \
    --to=pierre.langlois@gmx.com \
    --cc=50879@debbugs.gnu.org \
    /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).