simplified pattern matching

cleanup
m455 2020-07-16 17:04:55 -04:00
parent 6274772069
commit a0a7645e16
1 changed files with 2 additions and 4 deletions

View File

@ -301,16 +301,14 @@
(format " ~a ~a 2" program-name rm-command))))
(define (process-args vectorof-args)
(define (args-ref number)
(vector-ref vectorof-args number))
(match vectorof-args
[(or (vector (== help-command-1))
(vector (== help-command-2))
(vector (== help-command-3))) (help)]
[(vector (== ls-command)) (ls)]
[(vector (== init-command)) (init)]
[(vector (== add-command) _) (add (args-ref 1))]
[(vector (== rm-command) _) (rm (args-ref 1))]
[(vector (== add-command) a) (add a)]
[(vector (== rm-command) a) (rm a)]
[(vector _ _ _ ...)
(displayln-messages-ref 'error-too-many-arguments)]
[(vector _ _)