unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#33454] [PATCH] describe: Add profile option.
@ 2018-11-21  8:59 Oleg Pykhalov
  2018-11-21  9:40 ` Ludovic Courtès
  2018-11-21 14:27 ` [bug#33454] [PATCH] describe: Delete directory argument from 'display-checkout-info' Oleg Pykhalov
  0 siblings, 2 replies; 6+ messages in thread
From: Oleg Pykhalov @ 2018-11-21  8:59 UTC (permalink / raw)
  To: 33454

* guix/scripts/describe.scm (%options): Add profile option.
(show-help): Document this.
(display-checkout-info): Check for profile argument.
* doc/guix.texi (Invoking guix describe): Document this.
---
 doc/guix.texi             |  4 ++++
 guix/scripts/describe.scm | 15 +++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 3e7b0a9f4..274d4dfd1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3278,6 +3278,10 @@ guix pull});
 @cindex JSON
 produce a list of channel specifications in JSON format.
 @end table
+
+@item --profile=@var{profile}
+@itemx -p @var{profile}
+Display information in the given @var{profile}.
 @end table
 
 @node Invoking guix pack
diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index 53195b423..251be8c21 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -42,6 +42,10 @@
                   (unless (member arg '("human" "channels" "json"))
                     (leave (G_ "~a: unsupported output format~%") arg))
                   (alist-cons 'format (string->symbol arg) result)))
+        (option '(#\p "profile") #t #f
+                (lambda (opt name arg result)
+                  (alist-cons 'profile (canonicalize-profile arg)
+                              result)))
         (option '(#\h "help") #f #f
                 (lambda args
                   (show-help)
@@ -59,6 +63,8 @@
 Display information about the channels currently in use.\n"))
   (display (G_ "
   -f, --format=FORMAT    display information in the given FORMAT"))
+  (display (G_ "
+  -p, --profile=PROFILE  display information in the given PROFILE"))
   (newline)
   (display (G_ "
   -h, --help             display this help and exit"))
@@ -79,11 +85,11 @@ Display information about the channels currently in use.\n"))
         (format #t (G_ "~%;; warning: GUIX_PACKAGE_PATH=\"~a\"~%")
                 string))))))
 
-(define (display-checkout-info fmt)
+(define* (display-checkout-info fmt #:optional directory)
   "Display information about the current checkout according to FMT, a symbol
 denoting the requested format.  Exit if the current directory does not lie
 within a Git checkout."
-  (let* ((program    (car (command-line)))
+  (let* ((program    (or directory (car (command-line))))
          (directory  (catch 'git-error
                        (lambda ()
                          (repository-discover (dirname program)))
@@ -171,9 +177,10 @@ in the format specified by FMT."
                                       name))
                              cons
                              %default-options))
-         (format (assq-ref opts 'format)))
+         (format (assq-ref opts 'format))
+         (profile (or (assq-ref opts 'profile) (current-profile))))
     (with-error-handling
-      (match (current-profile)
+      (match profile
         (#f
          (display-checkout-info format))
         (profile
-- 
2.19.1

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

* [bug#33454] [PATCH] describe: Add profile option.
  2018-11-21  8:59 [bug#33454] [PATCH] describe: Add profile option Oleg Pykhalov
@ 2018-11-21  9:40 ` Ludovic Courtès
  2018-11-21 11:48   ` Oleg Pykhalov
  2018-11-21 14:27 ` [bug#33454] [PATCH] describe: Delete directory argument from 'display-checkout-info' Oleg Pykhalov
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2018-11-21  9:40 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 33454

Hi Oleg,

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> * guix/scripts/describe.scm (%options): Add profile option.
> (show-help): Document this.
> (display-checkout-info): Check for profile argument.
> * doc/guix.texi (Invoking guix describe): Document this.

Good idea!

> +@itemx -p @var{profile}
> +Display information in the given @var{profile}.

s/in the given/about/

> +  (display (G_ "
> +  -p, --profile=PROFILE  display information in the given PROFILE"))

Same here.

OK with these changes, thanks!

Ludo’.

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

* [bug#33454] [PATCH] describe: Add profile option.
  2018-11-21  9:40 ` Ludovic Courtès
@ 2018-11-21 11:48   ` Oleg Pykhalov
  0 siblings, 0 replies; 6+ messages in thread
From: Oleg Pykhalov @ 2018-11-21 11:48 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 33454, 33454-done

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

Hi Ludovic,

ludo@gnu.org (Ludovic Courtès) writes:

[…]

> OK with these changes, thanks!

Thanks, applied with your suggestions as
1255400faabfcf0ca1666d17f2f34ea0d49f6b1f

Oleg.

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

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

* [bug#33454] [PATCH] describe: Delete directory argument from 'display-checkout-info'.
  2018-11-21  8:59 [bug#33454] [PATCH] describe: Add profile option Oleg Pykhalov
  2018-11-21  9:40 ` Ludovic Courtès
@ 2018-11-21 14:27 ` Oleg Pykhalov
  2018-11-27 10:25   ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Oleg Pykhalov @ 2018-11-21 14:27 UTC (permalink / raw)
  To: 33454

This commit is a following 1255400faabfcf0ca1666d17f2f34ea0d49f6b1f which
added unused optional 'directory' argument.

* guix/scripts/describe.scm (display-checkout-info): Delete directory
argument.
---
 guix/scripts/describe.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index d817d7f7c..761f212f0 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -84,11 +84,11 @@ Display information about the channels currently in use.\n"))
         (format #t (G_ "~%;; warning: GUIX_PACKAGE_PATH=\"~a\"~%")
                 string))))))
 
-(define* (display-checkout-info fmt #:optional directory)
+(define (display-checkout-info fmt)
   "Display information about the current checkout according to FMT, a symbol
 denoting the requested format.  Exit if the current directory does not lie
 within a Git checkout."
-  (let* ((program    (or directory (car (command-line))))
+  (let* ((program    (car (command-line)))
          (directory  (catch 'git-error
                        (lambda ()
                          (repository-discover (dirname program)))
-- 
2.19.1

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

* [bug#33454] [PATCH] describe: Delete directory argument from 'display-checkout-info'.
  2018-11-21 14:27 ` [bug#33454] [PATCH] describe: Delete directory argument from 'display-checkout-info' Oleg Pykhalov
@ 2018-11-27 10:25   ` Ludovic Courtès
  2018-11-27 17:13     ` Oleg Pykhalov
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2018-11-27 10:25 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 33454

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> This commit is a following 1255400faabfcf0ca1666d17f2f34ea0d49f6b1f which
> added unused optional 'directory' argument.
>
> * guix/scripts/describe.scm (display-checkout-info): Delete directory
> argument.

LGTM!  I had overlooked this…

Thanks,
Ludo’.

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

* [bug#33454] [PATCH] describe: Delete directory argument from 'display-checkout-info'.
  2018-11-27 10:25   ` Ludovic Courtès
@ 2018-11-27 17:13     ` Oleg Pykhalov
  0 siblings, 0 replies; 6+ messages in thread
From: Oleg Pykhalov @ 2018-11-27 17:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 33454, 33454-done

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

ludo@gnu.org (Ludovic Courtès) writes:

> Oleg Pykhalov <go.wigust@gmail.com> skribis:
>
>> This commit is a following 1255400faabfcf0ca1666d17f2f34ea0d49f6b1f which
>> added unused optional 'directory' argument.
>>
>> * guix/scripts/describe.scm (display-checkout-info): Delete directory
>> argument.
>
> LGTM!

OK, pushed as 01262f1ece37d5ae9af56c1de6c4eefc758f35ba

Thanks,
Oleg.

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

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

end of thread, other threads:[~2018-11-27 17:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-21  8:59 [bug#33454] [PATCH] describe: Add profile option Oleg Pykhalov
2018-11-21  9:40 ` Ludovic Courtès
2018-11-21 11:48   ` Oleg Pykhalov
2018-11-21 14:27 ` [bug#33454] [PATCH] describe: Delete directory argument from 'display-checkout-info' Oleg Pykhalov
2018-11-27 10:25   ` Ludovic Courtès
2018-11-27 17:13     ` Oleg Pykhalov

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