Advertisement
Guest User

Untitled

a guest
Sep 13th, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (ns nanogen.core
  2.   (:gen-class))
  3.  
  4. (defn -main
  5.   "I don't do a whole lot ... yet."
  6.  
  7.   ;; Invalid call with no arguments
  8.   ([]
  9.   (println "No command found! Usage: nanogen <command> [args]"))
  10.  
  11.   ;; Proper call, optional arguments
  12.   ([command & args]
  13.    (println (resolve (symbol command)))
  14.    ;; Check if the command is a defined function, if true execute the function
  15.    ;; if not just display an error message
  16.    (if (fn? (resolve (symbol command)))
  17.      (command args)
  18.      (println (str "Command " command " not found!")))))
  19.  
  20. ;; Creates a site directory with the spcified name
  21. ;;  entries/
  22. ;;    hello-world.md
  23. ;;  settings/
  24. ;;    style.css
  25. (defn create
  26.   [site-name]
  27.   (println "Creating..."))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement