unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] scripts: scan-api: Make executable and add proper shebang.
@ 2023-11-10  3:42 Maxim Cournoyer
  2023-11-10 16:07 ` Maxim Cournoyer
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Cournoyer @ 2023-11-10  3:42 UTC (permalink / raw)
  To: guile-devel; +Cc: Maxim Cournoyer

* module/scripts/scan-api.scm: Invoke 'main' from shebang.
(main): Strip $0 from ARGS.
---

 module/scripts/scan-api.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 module/scripts/scan-api.scm

diff --git a/module/scripts/scan-api.scm b/module/scripts/scan-api.scm
old mode 100644
new mode 100755
index 86d07fc3e..e2ae99c23
--- a/module/scripts/scan-api.scm
+++ b/module/scripts/scan-api.scm
@@ -1,4 +1,7 @@
-;;; scan-api --- Scan and group interpreter and libguile interface elements
+#!/usr/bin/env -S guile -e '(@@ (scripts scan-api) main)' -s
+!#
+
+;; scan-api --- Scan and group interpreter and libguile interface elements
 
 ;; 	Copyright (C) 2002, 2006, 2011 Free Software Foundation, Inc.
 ;;
@@ -218,6 +221,8 @@
       (format #t ") ;; eof\n")))
   #t)
 
-(define main scan-api)
+(define (main args)
+  ;; Strip $0, which is the script name.
+  (apply scan-api (cdr args)))
 
 ;;; scan-api ends here

base-commit: 75cd95060fb1ea7586f0e4b9081694c6d61f1d3b
-- 
2.41.0




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts: scan-api: Make executable and add proper shebang.
  2023-11-10  3:42 [PATCH] scripts: scan-api: Make executable and add proper shebang Maxim Cournoyer
@ 2023-11-10 16:07 ` Maxim Cournoyer
  0 siblings, 0 replies; 2+ messages in thread
From: Maxim Cournoyer @ 2023-11-10 16:07 UTC (permalink / raw)
  To: guile-devel

Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> * module/scripts/scan-api.scm: Invoke 'main' from shebang.
> (main): Strip $0 from ARGS.

After reading module/scripts/README, this may have been misguided; it
seems these 'commands' are intended to be used with the 'guild'
launcher, e.g.:

--8<---------------cut here---------------start------------->8---
./meta/guild scan-api arg ...
--8<---------------cut here---------------end--------------->8---

Feel free to disregard this patch.

-- 
Thanks,
Maxim



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-10 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-10  3:42 [PATCH] scripts: scan-api: Make executable and add proper shebang Maxim Cournoyer
2023-11-10 16:07 ` Maxim Cournoyer

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).