summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntero Mejr <antero@mailbox.org>2022-12-03 01:09:36 +0000
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-01-16 08:50:05 -0500
commitabd956957138d4c5339e9cb79dd590fc19808438 (patch)
tree201845a5b8c3f20ccf49e1c773e60ea42e644a13
parentcf316d59aa1b4b372281b6060e56f2bbf7c541b1 (diff)
downloadguix-abd956957138d4c5339e9cb79dd590fc19808438.tar.gz
scripts: repl: Add --list-types flag.
* guix/scripts/repl.scm (%options): Add --list-types.
* doc/guix.texi (Invoking guix repl): Add documentation for --list-types.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
-rw-r--r--doc/guix.texi4
-rw-r--r--guix/scripts/repl.scm6
2 files changed, 10 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index acb0a6da9b..e8cd2a90a0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -12031,6 +12031,10 @@ of Guix.
 The available options are as follows:
 
 @table @code
+@item --list-types
+Display the @var{TYPE} options for @command{guix repl --type=TYPE} and
+exit.
+
 @item --type=@var{type}
 @itemx -t @var{type}
 Start a REPL of the given @var{TYPE}, which can be one of the following:
diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm
index 50d18c7760..0ec62786e9 100644
--- a/guix/scripts/repl.scm
+++ b/guix/scripts/repl.scm
@@ -52,6 +52,10 @@
         (option '(#\t "type") #t #f
                 (lambda (opt name arg result)
                   (alist-cons 'type (string->symbol arg) result)))
+        (option '("list-types") #f #f
+                (lambda (opt name arg result)
+                  (display (string-join '("guile" "machine") "\n" 'suffix))
+                  (exit 0)))
         (option '("listen") #t #f
                 (lambda (opt name arg result)
                   (alist-cons 'listen arg result)))
@@ -71,6 +75,8 @@
 In the Guix execution environment, run FILE as a Guile script with
 command-line arguments ARGS.  If no FILE is given, start a Guile REPL.\n"))
   (display (G_ "
+      --list-types       display REPL types and exit"))
+  (display (G_ "
   -t, --type=TYPE        start a REPL of the given TYPE"))
   (display (G_ "
       --listen=ENDPOINT  listen to ENDPOINT instead of standard input"))