unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 56083@debbugs.gnu.org
Subject: [bug#56083] [PATCH] style: Add option '--list-stylings'.
Date: Sun, 19 Jun 2022 10:37:47 +0200	[thread overview]
Message-ID: <bad30ecc00bc6c29f22dd515068e010064ebf05e.1655627838.git.h.goebel@crazy-compilers.com> (raw)

* guix/scripts/style.scm (show-stylings): New procedure.
  (%options, show-help): Add "--list-stylings".
* doc/guix.texi (Invoking guix style): Document "-l".
---
 doc/guix.texi          |  4 ++++
 guix/scripts/style.scm | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 86348fc02c..2768762e62 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13963,6 +13963,10 @@ The @option{--input-simplification} option described below provides
 fine-grain control over when inputs should be simplified.
 @end table
 
+@item --list-stylings
+@itemx -l
+List and describe the available styling rule and exit.
+
 @item --load-path=@var{directory}
 @itemx -L @var{directory}
 Add @var{directory} to the front of the package module search path
diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm
index 8123570c38..3381a54130 100644
--- a/guix/scripts/style.scm
+++ b/guix/scripts/style.scm
@@ -797,15 +797,26 @@ PACKAGE."
                 (lambda args
                   (show-help)
                   (exit 0)))
+        (option '(#\l "list-stylings") #f #f
+                (lambda args
+                  (show-stylings)
+                  (exit 0)))
         (option '(#\V "version") #f #f
                 (lambda args
                   (show-version-and-exit "guix style")))))
 
+(define (show-stylings)
+  (display (G_ "Available styling rules:\n"))
+  (display (G_ "- format: Format the given package definition(s)\n"))
+  (display (G_ "- inputs: Rewrite package inputs to the “new style”\n")))
+
 (define (show-help)
   (display (G_ "Usage: guix style [OPTION]... [PACKAGE]...
 Update package definitions to the latest style.\n"))
   (display (G_ "
   -S, --styling=RULE     apply RULE, a styling rule"))
+  (display (G_ "
+  -l, --list-stylings   display the list of available style rules"))
   (newline)
   (display (G_ "
   -n, --dry-run          display files that would be edited but do nothing"))
-- 
2.30.4





             reply	other threads:[~2022-06-19  8:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19  8:37 Hartmut Goebel [this message]
2022-06-19  9:02 ` [bug#56083] [PATCH] style: Add option '--list-stylings' Maxime Devos
2022-07-04 14:14   ` Hartmut Goebel
2022-07-04 14:17   ` bug#56083: " Hartmut Goebel

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=bad30ecc00bc6c29f22dd515068e010064ebf05e.1655627838.git.h.goebel@crazy-compilers.com \
    --to=h.goebel@crazy-compilers.com \
    --cc=56083@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).