Skylar Hill
57ce73370d
As we expand with new features and get tree-sitter working, we're going to have more to keep track of than can reasonably be done with individual arguments. Guile's modified srfi-9 lets us do this in a nice functional style. This also subtly tweaks the behavior of character insertion so it's actually correct.
52 lines
1.3 KiB
Text
52 lines
1.3 KiB
Text
#!@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 (option-ref options '(file) #f)))
|
|
|
|
;;; Local Variables:
|
|
;;; mode: scheme
|
|
;;; End:
|