GNU bug report logs -
#59754
[PATCH] scripts: repl: Add --interactive and --list-types flags.
Previous Next
Reported by: Antero Mejr <antero <at> mailbox.org>
Date: Fri, 2 Dec 2022 02:58:01 UTC
Severity: normal
Tags: patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 16 Jan 2023 09:03:42 -0500
with message-id <87cz7ebmpt.fsf_-_ <at> gmail.com>
and subject line Re: bug#59754: [PATCH] scripts: repl: Add --interactive and --list-types flags.
has caused the debbugs.gnu.org bug report #59754,
regarding [PATCH] scripts: repl: Add --interactive and --list-types flags.
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
59754: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59754
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
* guix/scripts/repl.scm (guix-repl): Honor -i, --interactive flag.
(%options): Add -i/--interactive and --l/--list-types.
---
guix/scripts/repl.scm | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm
index 50d18c7760..eac3d7264e 100644
--- a/guix/scripts/repl.scm
+++ b/guix/scripts/repl.scm
@@ -52,12 +52,19 @@ (define %options
(option '(#\t "type") #t #f
(lambda (opt name arg result)
(alist-cons 'type (string->symbol arg) result)))
+ (option '(#\l "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)))
(option '(#\q) #f #f
(lambda (opt name arg result)
(alist-cons 'ignore-dot-guile? #t result)))
+ (option '(#\i "interactive") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'interactive? #t result)))
(option '(#\L "load-path") #t #f
(lambda (opt name arg result)
;; XXX: Imperatively modify the search paths.
@@ -78,9 +85,15 @@ (define (show-help)
-q inhibit loading of ~/.guile"))
(newline)
(display (G_ "
+ -i, --interactive launch REPL after evaluating FILE"))
+ (newline)
+ (display (G_ "
-L, --load-path=DIR prepend DIR to the package module search path"))
(newline)
(display (G_ "
+ -l, --list-types display REPL types and exit"))
+ (newline)
+ (display (G_ "
-h, --help display this help and exit"))
(display (G_ "
-V, --version display version information and exit"))
@@ -190,7 +203,7 @@ (define script
;; file in %LOAD-PATH. Thus, pass (getcwd) instead of ".".
(load-in-vicinity (getcwd) (car script)))))
- (when (null? script)
+ (when (or (null? script) (assoc-ref opts 'interactive?))
;; Start REPL
(let ((type (assoc-ref opts 'type)))
(call-with-connection (assoc-ref opts 'listen)
--
2.38.1
[Message part 3 (message/rfc822, inline)]
Hello,
Antero Mejr <antero <at> mailbox.org> writes:
> * guix/scripts/repl.scm (%options): Add -i, --interactive flag.
> (guix-repl): Honor -i, --interactive flag.
> * doc/guix.texi (Invoking guix repl): Add documentation for -i, --interactive.
I've added your copyright to the guix.texi file and made a small
adjustment, as shown below:
--8<---------------cut here---------------start------------->8---
modified doc/guix.texi
@@ -111,6 +111,7 @@ Copyright @copyright{} 2022 (@*
Copyright @copyright{} 2022 John Kehayias@*
Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@*
Copyright @copyright{} 2023 Giacomo Leidi@*
+Copyright @copyright{} 2022 Antero Mejr@*
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -12070,7 +12071,7 @@ Accept connections on the Unix-domain socket @file{/tmp/socket}.
@item --interactive
@itemx -i
-Launch the interactive REPL after @var{FILE} is executed.
+Launch the interactive REPL after @var{file} is executed.
@item --load-path=@var{directory}
@itemx -L @var{directory}
--8<---------------cut here---------------end--------------->8---
And pushed! Thanks for the contribution and to Simon for the review!
--
Thanks,
Maxim
This bug report was last modified 2 years and 121 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.