From 83175c4f427622107b4e86cdf2d2d21900631fb6 Mon Sep 17 00:00:00 2001 From: felix Date: Wed, 16 Sep 2020 19:17:53 +0200 Subject: [PATCH] check single-char options when canonicalizing csi's command line, drop obsolete -v option --- csi.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/csi.scm b/csi.scm index 5560024f..ebac8e02 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)) ) -- 2.24.2