~ chicken-core (chicken-5) 408bf40824488a07c428d29294f044e1811d7383
commit 408bf40824488a07c428d29294f044e1811d7383 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Wed Sep 16 19:17:53 2020 +0200 Commit: Evan Hanson <evhan@foldling.org> CommitDate: Fri Dec 4 12:14:08 2020 +1300 Check single-char options when canonicalizing csi's command line, drop obsolete -v option Signed-off-by: Evan Hanson <evhan@foldling.org> diff --git a/csi.scm b/csi.scm index 5560024f..dd127352 100644 --- a/csi.scm +++ b/csi.scm @@ -926,7 +926,7 @@ EOF (else (find (cdr ks))) ) ) ) ) ) (define-constant short-options - '(#\k #\s #\v #\h #\D #\e #\i #\R #\b #\n #\q #\w #\- #\I #\p #\P) ) + '(#\k #\s #\h #\D #\e #\i #\R #\b #\n #\q #\w #\- #\I #\p #\P) ) (define-constant long-options '("-ss" "-sx" "-script" "-version" "-help" "--help" "-feature" "-no-feature" "-eval" @@ -941,6 +941,11 @@ EOF '() (let ((x (car args))) (cond ((member x '("-s" "-ss" "-script" "-sx" "--")) args) + ((and (fx= (##sys#size x) 2) + (char=? #\- (##core#inline "C_subchar" x 0))) + (if (memq (##core#inline "C_subchar" x 1) short-options) + (cons x (loop (cdr args))) + (##sys#error "invalid option" x))) ((and (fx> (##sys#size x) 2) (char=? #\- (##core#inline "C_subchar" x 0)) (not (member x long-options)) )Trap