unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: 58660@debbugs.gnu.org
Cc: othacehe@gnu.org, zimoun <zimon.toutoune@gmail.com>
Subject: [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand.
Date: Thu, 17 Nov 2022 21:28:18 +0100	[thread overview]
Message-ID: <20221117202820.2054593-1-zimon.toutoune@gmail.com> (raw)
In-Reply-To: <20221020132140.1546684-1-zimon.toutoune@gmail.com>

* etc/teams.scm.in: Add 'show' subcommand.
---
 etc/teams.scm.in | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index c458b14e3b..e4e0dc209d 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -5,6 +5,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -538,7 +539,7 @@ (define port* (or port (current-output-port)))
     (team-members team)
     (lambda (m1 m2) (string<? (person-name m1) (person-name m2))))))
 
-(define (list-teams)
+(define* (list-teams #:optional team-names)
   "Print all teams, their scope and their members."
   (define port* (current-output-port))
   (define width* (%text-width))
@@ -564,11 +565,13 @@ (define width* (%text-width))
                (scope (format #f "scope: ~{~s ~}~%" scope))))
      (list-members team port* "+ ")
      (newline))
-   (sort
-    (hash-map->list (lambda (key value) value) %teams)
-    (lambda (team1 team2)
-      (string<? (symbol->string (team-id team1))
-                (symbol->string (team-id team2)))))))
+   (if team-names
+       (map find-team team-names)
+       (sort
+        (hash-map->list (lambda (key value) value) %teams)
+        (lambda (team1 team2)
+          (string<? (symbol->string (team-id team1))
+                    (symbol->string (team-id team2))))))))
 
 \f
 (define (diff-revisions rev-start rev-end)
@@ -611,6 +614,8 @@ (define (main . args)
       (lambda (team-name)
         (list-members (find-team team-name)))
       team-names))
+    (("show" . team-names)
+     (list-teams team-names))
     (anything
      (format (current-error-port)
              "Usage: etc/teams.scm <command> [<args>]
@@ -619,6 +624,7 @@ (define (main . args)
   cc <team-name>            get git send-email flags for cc-ing <team-name>
   cc-members <start> <end>  cc teams related to files changed between revisions
   list-teams                list teams and their members
-  list-members <team-name>  list members belonging to <team-name>~%"))))
+  list-members <team-name>  list members belonging to <team-name>
+  show <team-name>          display <team-name> properties~%"))))
 
 (apply main (cdr (command-line)))
-- 
2.38.1





  parent reply	other threads:[~2022-11-17 20:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221020132140.1546684-1-zimon.toutoune@gmail.com>
2022-10-20 13:28 ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display zimoun
2022-10-20 13:28   ` [bug#58660] [PATCH 3/4] etc: teams: List teams sorted by id zimoun
2022-10-20 13:28   ` [bug#58660] [PATCH 4/4] etc: teams: Display an id number zimoun
2022-11-05 12:18   ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display ( via Guix-patches via
2022-11-05 13:09     ` zimoun
2022-11-05 13:29       ` ( via Guix-patches via
2022-11-04 10:11 ` [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm zimoun
2022-11-09 16:23 ` Mathieu Othacehe
2022-11-17 20:27   ` zimoun
2022-11-18 17:31     ` Mathieu Othacehe
2022-11-17 20:28 ` zimoun [this message]
2022-11-17 20:28   ` [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field zimoun
2022-11-18 17:23     ` Mathieu Othacehe
2022-11-21 14:11       ` zimoun
2023-08-29 18:58         ` bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm Maxim Cournoyer
2022-11-17 20:28   ` [bug#58660] [PATCH v2 3/3] etc: teams: Improve display of regular expression in 'scope' field zimoun
2022-11-18 17:29   ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand Mathieu Othacehe
2022-11-21 16:00     ` zimoun

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=20221117202820.2054593-1-zimon.toutoune@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=58660@debbugs.gnu.org \
    --cc=othacehe@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).