lilu-swank-script.ros 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. #|-*- mode:lisp -*-|#
  3. #|
  4. exec ros -Q -- $0 "$@"
  5. |#
  6. (progn ;;init forms
  7. (ros:ensure-asdf)
  8. #+quicklisp(ql:quickload '(:lilu-desk
  9. :lilu-swank-client/client
  10. :lilu-roswell
  11. :cffi)
  12. :silent t))
  13. (defpackage :ros.script.lilu-server.3766064849
  14. (:use :cl))
  15. (in-package :ros.script.lilu-server.3766064849)
  16. (opts:define-opts
  17. #.lilu-roswell:*default-help-option*
  18. #.(lilu-roswell:merge-options
  19. lilu-roswell:*default-swank-port-option*
  20. '(:default lilu-swank:*default-swank-port*))
  21. #.(lilu-roswell:merge-options
  22. lilu-roswell:*default-swank-host-option*
  23. '(:default lilu-swank-client:*default-swank-host*))
  24. (:name :quit
  25. :description "quit swank server"
  26. :required nil
  27. :default nil
  28. :short #\q
  29. :long "quit")
  30. #.lilu-roswell:*default-debugger-option*
  31. )
  32. (defun main (&rest argv)
  33. (lilu-roswell:init)
  34. (multiple-value-bind (options free-args)
  35. (lilu-roswell:parse-options argv :free-args-p t :max-free-args 1 :min-free-args 1)
  36. (lilu-roswell:options-check-for-help options
  37. :prefix "connect to a swank server and evalute a script"
  38. :suffix "so that's how it works…"
  39. :usage-of "lilu-swank-script.ros"
  40. :args "SCRIPT")
  41. (let ((args (lilu-roswell:options-get-keys options :port :host :debugger)))
  42. (lilu-debugger:with-debugger (:abort)
  43. (apply #'lilu-swank-client:remote-eval-script (car free-args) args))
  44. (when (lilu-roswell:options-get-value options :quit)
  45. (lilu-swank-client:remote-eval-strings "(lilu-roswell:cl-quit)")))))
  46. ;;; vim: set ft=lisp lisp: