fixed some functions

main
m455 2018-04-06 00:12:58 -04:00
parent cf22f99d68
commit ca1d6d0fc4
1 changed files with 18 additions and 10 deletions

View File

@ -68,6 +68,12 @@
" init` " " init` "
"to set it up\n") "to set it up\n")
'terminating
(string-append
"> Exiting "
program-name
" ...\n")
'choose-y/n 'choose-y/n
"> Error: Please choose y or n\n" "> Error: Please choose y or n\n"
@ -81,13 +87,7 @@
"> Removed " "> Removed "
'item-removed-suffix 'item-removed-suffix
" from list\n" " from list\n"))
'terminating
(string-append
"> Exiting "
program-name
" ...\n")))
(define y/n (define y/n
(hash (hash
@ -154,6 +154,16 @@
(d-hash-ref messages 'not-found) (d-hash-ref messages 'not-found)
(d-hash-ref messages 'try-initializing)))) (d-hash-ref messages 'try-initializing))))
(define (remove-item args)
(if (check-for-folder)
(begin
(d-hash-ref messages 'item-removed-prefix)
(d-vector-ref args 1)
(d-hash-ref messages 'item-removed-suffix))
(begin
(d-hash-ref messages 'not-found)
(d-hash-ref messages 'try-initializing))))
(define (check-args args) (define (check-args args)
(let (let
([args-length (vector-length args)]) ([args-length (vector-length args)])
@ -166,9 +176,7 @@
[(and [(and
(equal? args-length 2) (equal? args-length 2)
(equal? (vector-member "remove" args) 0)) (equal? (vector-member "remove" args) 0))
(d-hash-ref messages 'item-removed-prefix) (remove-item args)]
(d-vector-ref args 1)
(d-hash-ref messages 'item-removed-suffix)]
[(and [(and
(equal? args-length 1) (equal? args-length 1)