Files
git-cli/main.rkt
T

36 lines
828 B
Racket

#lang racket/base
(require "private/git-provider.rkt"
"private/git-commands.rkt"
"private/config.rkt"
simple-log
)
(provide git)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Provided commands
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (git command . args)
(cond
([eq? command 'status] (cmd-git-status args))
([eq? command 'add] (cmd-git-add args))
([eq? command 'commit] (cmd-git-commit args))
(else (error "Not supported git command '~a" command))
)
)
(define-syntax def-cmd
(syntax-rules ()
((_ cmd cmd*)
(define (cmd . args)
(cmd* args)))))
(def-cmd git-status cmd-git-status)
(def-cmd git-add cmd-git-add)
(def-cmd git-commit cmd-git-commit)