wow that was a bad bug

cleanup
m455 2020-06-20 00:44:31 -04:00
parent 4b575c355d
commit be6c36d3d3
2 changed files with 11 additions and 11 deletions

Binary file not shown.

View File

@ -183,8 +183,8 @@
;; ------------------------------------------------
;; rm
;; ------------------------------------------------
(define (rm/remove-item listof-items item-number)
(let* ([item-to-remove (list-ref listof-items item-number)]
(define (rm/remove-item listof-items item-number-sub1)
(let* ([item-to-remove (list-ref listof-items item-number-sub1)]
[list-without-item (remove item-to-remove listof-items)])
(display-lines-to-file list-without-item
program-path
@ -283,18 +283,18 @@
;; Proper usage
[(or '#("-h")
'#("--help")
'#(help-command)) (help)]
[(vector add-command _) (add (args-ref 1))]
[(vector rm-command _) (rm (args-ref 1))]
[(vector ls-command) (ls)]
'#("help")) (help)]
[(vector "add" _) (add (args-ref 1))]
[(vector "rm" _) (rm (args-ref 1))]
[(vector "ls") (ls)]
[(vector) (random-message)]
;; Improper usage
;; This is checked so we can give the user hints on how to
;; use the software if they have part of the command
;; correct
[(vector ls-command _) (displayln-message-list 'error-ls)]
[(vector add-command) (displayln-message-list 'error-add)]
[(vector rm-command) (displayln-message-list 'error-rm)]
[(vector "ls" _) (displayln-message-list 'error-ls)]
[(vector "add") (displayln-message-list 'error-add)]
[(vector "rm") (displayln-message-list 'error-rm)]
[(vector _ ...) (displayln-message-list 'error-usage)]))
(define (main vectorof-args)