# HG changeset patch # User Steve Losh # Date 1545423874 18000 # Node ID 11bce44c17e97f558832393ccbd87d6db5cffba1 # Parent e3f5572c77389441f3fbc9b0dff20fdd5b930c4c More diff -r e3f5572c7738 -r 11bce44c17e9 lisp/_skeleton.lisp --- a/lisp/_skeleton.lisp Thu Dec 20 23:55:17 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -(ql:quickload '(:adopt)) - -;;;; Config ------------------------------------------------------------------- -(defparameter *default-name* "World") - - -;;;; Functionality ------------------------------------------------------------ -(defun run (name) - (format t "Hello, ~A~%" name)) - - -;;;; CLI ---------------------------------------------------------------------- -(adopt:define-interface *ui* "NAME" - "Say Hello." - ((help) "display help and exit" - :long "help" - :short #\h - :reduce (constantly t)) - ((name) (format nil "say hello to NAME (default ~A)" *default-name*) - :long "name" - :short #\n - :parameter "NAME" - :initial-value *default-name* - :reduce #'adopt:newest)) - -(defun toplevel () - (multiple-value-bind (arguments options) (adopt:parse-options *ui*) - (when (gethash 'help options) - (adopt:print-usage *ui*) - (adopt:exit 0)) - (unless (null arguments) - (cerror "Ignore them" "Unrecognized command-line arguments: ~S" arguments)) - (run (gethash 'name options)))) diff -r e3f5572c7738 -r 11bce44c17e9 lisp/example.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/example.lisp Fri Dec 21 15:24:34 2018 -0500 @@ -0,0 +1,41 @@ +(ql:quickload '(:adopt)) + +;;;; Config ------------------------------------------------------------------- +(defparameter *default-name* "World") + + +;;;; Functionality ------------------------------------------------------------ +(defun run (name) + (format t "Hello, ~A~%" name)) + + +;;;; CLI ---------------------------------------------------------------------- +(adopt:define-interface *ui* + (:name "example" + :usage "[-n NAME]" + :summary "Say Hello." + :documentation "An example program to show how to make well-behaved CLI tools in Common Lisp." + :examples '(("Say hello:" . "example") + ("Say hello to Alice:" . "example --name Alice"))) + (help + :documentation "display help and exit" + :long "help" + :short #\h + :reduce (constantly t)) + (name + :documentation (format nil "say hello to NAME (default ~A)" *default-name*) + :long "name" + :short #\n + :parameter "NAME" + :initial-value *default-name* + :reduce #'adopt:newest)) + +(defun toplevel () + (handler-case + (multiple-value-bind (arguments options) (adopt:parse-options *ui*) + (when (gethash 'help options) + (adopt:print-usage-and-exit *ui*)) + (unless (null arguments) + (error "Unrecognized command-line arguments: ~S" arguments)) + (run (gethash 'name options))) + (error (c) (adopt:print-error-and-exit c)))) diff -r e3f5572c7738 -r 11bce44c17e9 vim/custom-dictionary.utf-8.add --- a/vim/custom-dictionary.utf-8.add Thu Dec 20 23:55:17 2018 -0500 +++ b/vim/custom-dictionary.utf-8.add Fri Dec 21 15:24:34 2018 -0500 @@ -269,3 +269,4 @@ dropdown jQuery deserializes +healthchecks