[PATCH] Fix help option parsing

Pietro Monteiro via Cgen <[email protected]> Thu, 03 Apr 2025 11:58:33 -0400
Newsgroups gmane.comp.tools.cgen.devel
Message-ID <[email protected]>
Running `guile -l ../cgen/guile.scm -s ../cgen/cgen-opc.scm --help' fails to
display the application specific options.

The app options use a lambda which can't be `string-append'ed. So non-string
objects on the args list.

This also fix `cgen-opc.scm' and I imagine the other applications too.

Signed-off-by: Pietro Monteiro <[email protected]>
---
 read.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/read.scm b/read.scm
index 392e7ba..5b5548b 100644
--- a/read.scm
+++ b/read.scm
@@ -1143,9 +1143,11 @@ Define a preprocessor-style macro.
 			  "  - " (caddr arg)
 			  (apply string-append
 				 (map (lambda (text)
-					(string-append "\n"
-						       (string-take 20 "")
-						       text))
+                                        (if (string? text)
+                                            (string-append "\n"
+                                                           (string-take 20 "")
+                                                           text)
+                                            ""))
 				      (cdddr arg)))
 			  "\n")
 			 cep))
-- 
2.47.0