Improve command-line syntax.

This commit is contained in:
Dominik Pantůček 2023-03-14 21:10:18 +01:00
parent 0f9e5e2313
commit 84c5aac95e
2 changed files with 8 additions and 8 deletions

View file

@ -57,12 +57,14 @@
(command-line (command-line
print-help print-help
(-h "This help" () (-h () "This help"
(print "Command-line options:") (print "Command-line options:")
(newline) (newline)
(print-help) (print-help)
(newline) (newline)
(exit 0)) (exit 0))
(-mfkw "Member-File invalid Key Warning" () (*member-file-check-syntax* 'warning)) (-mfkw () "Member-File invalid Key Warning" (*member-file-check-syntax* 'warning))
(-mfkq "Member-File invalid Key Quiet" () (*member-file-check-syntax* 'quiet)) (-mfkq () "Member-File invalid Key Quiet" (*member-file-check-syntax* 'quiet))
(-mfec "Member-File parser Error Context (lines)" (n) (*member-file-context* (string->number n)))) (-mfec (n) "Member-File parser Error Context (lines)" (*member-file-context* (string->number n))))
(load-member-file "members/joe")

View file

@ -121,12 +121,10 @@
(syntax-rules () (syntax-rules ()
((_ opt help proc) ((_ opt help proc)
(list (symbol->string 'opt) help proc)) (list (symbol->string 'opt) help proc))
((_ opt help (args ...) body ...) ((_ opt (args ...) help body ...)
(list (symbol->string 'opt) (list (symbol->string 'opt)
help help
(lambda (args ...) body ...))) (lambda (args ...) body ...)))))
((_ opt help)
(list (symbol->string 'opt) help 'help))))
;; Simple syntax wrapper for command-line arguments specification and ;; Simple syntax wrapper for command-line arguments specification and
;; immediate parsing. ;; immediate parsing.