1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #!/run/current-system/profile/bin/guile \
- --no-auto-compile -e (`(s-chop-prefix "guile-" (file-name-nondirectory (buffer-file-name)))`) -s
- !#
- ;;;; `(s-chop-prefix "guile-" (file-name-nondirectory (buffer-file-name)))` --- SYNOPSIS
- ;;;; Copyright © `(nth 5 (decode-time))` `user-full-name` <`user-mail-address`>
- ;;;; Released under the GNU GPLv3 or any later version.
- (define-module (`(s-chop-prefix "guile-" (file-name-nondirectory (buffer-file-name)))`)
- #:use-module (srfi srfi-37)
- #:export (main))
- ;;; Commentary:
- ;;;
- ;;; DESCRIPTION
- ;;;
- ;;; Code:
- (define %options
- (let ((display-and-exit-proc (lambda (msg)
- (lambda (opt name arg loads)
- (display msg) (quit)))))
- (list (option '(#\v "version") #f #f
- (display-and-exit-proc "`(s-chop-prefix "guile-" (file-name-nondirectory (buffer-file-name)))` version 0.0.1\n"))
- (option '(#\h "help") #f #f
- (display-and-exit-proc
- "Usage: `(s-chop-prefix "guile-" (file-name-nondirectory (buffer-file-name)))` ...")))))
- (define %default-options
- '())
- (define (main args)
- (define opts
- (args-fold (cdr (program-arguments))
- %options
- (lambda (opt name arg loads)
- (error "Unrecognized option \`~A'" name))
- (lambda (op loads)
- (cons op loads))
- %default-options))
- )
- ;;; `(let* ((bfn (buffer-file-name)) (file (s-chop-prefix "guile-" (file-name-nondirectory bfn))) (directory (file-name-directory bfn))) (rename-buffer file) (setq buffer-file-name (concat directory file)) file)` ends here
|