2024-12-30 18:06:26 +01:00
|
|
|
#!/usr/bin/env -S scsh -e main -o srfi-1 -s
|
|
|
|
!#
|
|
|
|
|
|
|
|
(define (main args)
|
|
|
|
(let* ((class-name (cadr args))
|
|
|
|
(file-names
|
|
|
|
(run/strings (find "." -type f -name ,(string-append class-name ".php")
|
2024-12-30 20:36:07 +01:00
|
|
|
-exec grep "^namespace" "{}" ";")
|
2024-12-30 18:06:26 +01:00
|
|
|
(> 2 "/dev/null"))))
|
|
|
|
(format #t "~s"
|
|
|
|
(delete-duplicates
|
|
|
|
(map (lambda (n)
|
|
|
|
(string-append
|
|
|
|
(match:substring
|
|
|
|
(regexp-search (rx "namespace " (submatch (+ any)) ";") n)
|
|
|
|
1)
|
|
|
|
"\\"
|
|
|
|
class-name))
|
|
|
|
file-names)))))
|