sloth/scripts/sloth.in

56 lines
1.1 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))
;; 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)
(handle file-exists?)
(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))
(display (full-command options))
(newline)
#;
(match (full-command options) ;
((_ file) ;
(open file)) ;
((_) ;
(new-instance))))
;;; Local Variables:
;;; mode: scheme
;;; End: