~edwargix/tallyard

e8ec03112c1ec7eb22d4e091172e23cc239448e0 — David Florness 5 years ago 52dda57
Better output for some repl commands
1 files changed, 9 insertions(+), 3 deletions(-)

M bulletin.rkt
M bulletin.rkt => bulletin.rkt +9 -3
@@ 226,21 226,27 @@
                                       election
                                       (λ (l)
                                         (cons cand l))))]
                      [(? eof-object?) (displayln "add what? options are `cand'")]
                      [else (displayln "cannot add that")])]
              ['list (match (read sp)
                       ['cands
                        (displayln (hash-ref election->candidates election))]
                        (println (hash-ref election->candidates election))]
                       ['peers
                        (displayln (hash-values _peers))]
                        (println (hash-values _peers))]
                       ['elections
                        (displayln (format "current: ~a" election))
                        (displayln (hash-keys election->candidates))])]
                        (println (hash-keys election->candidates))]
                       [(? eof-object?)
                        (displayln "list what? options are `cands' `peers' `elections'")]
                       [else (displayln "cannot list that")])]
              ['set (match (read sp)
                      ['election (let* ([election (read sp)]
                                        [election (if (string? election)
                                                      (string->symbol election)
                                                      election)])
                                   (election-set! election))]
                       [(? eof-object?)
                        (displayln "set what? options are `election'")]
                      [else (displayln "cannot set that")])]
              ['open
               (if (memq state '(closed registering))