updated rodo.rkt and args.rkt

main
m455 2020-02-09 15:04:05 -05:00
parent 61f4fd4487
commit 3599f1ec1b
2 changed files with 6 additions and 12 deletions

View File

@ -10,8 +10,8 @@
(define (check-args args)
(let ([args-length (length args)]
[is-member? (lambda (command)
(member (list-ref args 0) command))])
[is-member? (lambda (command) (member (list-ref args 0) command))]
[args-second (string->number (list-ref args 1))])
(cond
[(equal? args-length 0)
(utils:display-messages '(show-usage))]
@ -39,13 +39,9 @@
;; remove-command
[(and (equal? args-length 2)
(is-member? config:remove-commands)
;; possibly replace this with something that checks
;; the length, the creates a range with that, starting
;; from zero, and checks to see if the user input
;; is a member of that list
(real? (string->number (list-ref args 1)))
(or (positive? (string->number (list-ref args 1)))
(zero? (string->number (list-ref args 1)))))
(real? args-second)
(or (positive? args-second)
(zero? args-second)))
(utils:check-remove-conditions args)]
[else (utils:display-messages '(show-usage))])))

View File

@ -1,9 +1,7 @@
#lang racket/base
(require (prefix-in args: "args.rkt"))
(define (main args)
(let ([args-converted (vector->list args)])
(args:check-args args-converted)))
(args:check-args (vector->list args)))
(main (current-command-line-arguments))