sloth/scripts/sloth.in

53 lines
1.2 KiB
Plaintext

#!@GUILE@ \
--no-auto-compile -e main -s
!#
;; bin/sloth --- sloth text editor -*- coding: utf-8 -*-
;;; Commentary:
;;;
;;; This is the entry file for sloth.
;;;
;;; Code:
(use-modules (config)
(config api)
(config licenses)
(config parser sexp)
(sloth editor)
(sloth interface)
(ncurses curses))
;; Commandline handling
(define %configuration
(configuration
(name 'sloth)
(version @HVERSION@)
(author @AUTHOR@)
(copyright @COPYRIGHT@)
(license @LICENSE@)
(synopsis "Text editor based on tree-sitter")
(description
"TODO")
(arguments
(list
(argument (name 'file)
(default "")
(test string?)
(synopsis "The file to open")
(example "./file.txt"))))
(directory (in-home ".config/"))
(parser simple-sexp-parser)
(generate-cmdtree? #t)))
(define (main args)
"(Listof String) -> Int
program entrypoint; handle commandline args and call appropriate procedures"
(define options (getopt-config-auto args %configuration))
(start-loop (init-frontend 'ncurses) (option-ref options '(file) #f)))
;;; Local Variables:
;;; mode: scheme
;;; End: