GithubHelp home page GithubHelp logo

triclops200 / quickapp Goto Github PK

View Code? Open in Web Editor NEW
49.0 5.0 4.0 27 KB

A common lisp project for generating template projects that use sbcl and buildapp

License: BSD 3-Clause "New" or "Revised" License

Common Lisp 100.00%

quickapp's Introduction

quickapp

Quicklisp

A common lisp project for generating template projects that use sbcl and buildapp

See https://github.com/triclops200/quickapp-cli for the command line standalone utility.

Example usage

(ql:quickload :quickapp)
(quickapp:quickapp
          "src/lisp/test-project"
          :project-name "test-project" 
          :executable-name "test.out" 
          :project-description "This is a sample test project" 
          :project-author "YOUR NAME HERE" 
          :dependencies '(:sdl2 :cl-openal))

This creates the needed files and Makefile as well as a template project.

For easy interactive development in slime, just do (assuming one is in their generated project directory):

(load "slime.lisp")
(in-package :<YOUR PACKAGE NAME>)

Arg parsing utilities

This library also contains two functions for dealing with argument handling for the generated application: (quickapp:parse-args) and (quickapp:generate-flag-string).

An example usage is shown below

(defun -main (&optional args)
  "Entry point"
  (let* ((arg-defs '(("h" "help" "Display this help menu")
	          ("d" "dependencies" "(:dep1 [:dep2 ...])" "The dependencies")
	          ("p" "project-name" "NAME" "The project name")
	          ("a" "project-author" "NAME" "The name of the author")
	          ("s" "project-description" "DESCRIPTION" "The project description")
	          ("e" "executable-name" "NAME" "The executable name")))
         (parsed-args (quickapp:parse-args arg-defs (cdr args))))
	  (if (or (/= (length (first parsed-args)) 1)
	          (assoc "help" (second parsed-args) :test #'string=))
		  (progn (format t "Usage: ~a PROJECT-PATH [OPTIONS]~%OPTIONS:~%~a~%~a~%~a~a~%~a~%~a~%"
			       (first args)
			       (quickapp:generate-flag-string arg-defs)
			       "Example Usage: " (first args) " test-project \\"
			       "  -d\"(:sdl2 :cl-opengl)\" \\"
			       "  --project-author=cluser"))
		  (format t "~a~%" parsed-args))))

Running that application with the --help flag results in:

Usage: ./quickapp PROJECT-PATH [OPTIONS]
OPTIONS:
  -h  --help                              Display this help menu
  -d  --dependencies=(:dep1 [:dep2 ...])  The dependencies
  -p  --project-name=NAME                 The project name
  -a  --project-author=NAME               The name of the author
  -s  --project-description=DESCRIPTION   The project description
  -e  --executable-name=NAME              The executable name

Example Usage: 
./quickapp test-project \
  -d"(:sdl2 :cl-opengl)" \
  --project-author=cluser

Running this command: ./quickapp test-project -d"(:sdl2 :cl-opengl)" --project-author=cluser results in this list returned as parsed-args

(("test-project")
 (("project-author" . "cluser") ("dependencies" . "(:sdl2 :cl-opengl)")))

#License Licensed under Modified BSD License.

See License.txt for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.