changelog shortlog graph tags branches changeset file revisions annotate raw help

Mercurial > core / lisp/lib/cli/clap/cmd.lisp

revision 683: c5fe76568de0
parent 655: 65102f74d1ae
child 688: 517c65b51e6b
     1.1--- a/lisp/lib/cli/clap/cmd.lisp	Sat Sep 28 16:42:55 2024 -0400
     1.2+++ b/lisp/lib/cli/clap/cmd.lisp	Sat Sep 28 17:48:06 2024 -0400
     1.3@@ -16,7 +16,7 @@
     1.4          :accessor opts :type (vector cli-opt))
     1.5    (cmds :initarg :cmds :initform (make-array 0 :element-type 'cli-cmd :adjustable t)
     1.6          :accessor cmds :type (vector cli-cmd))
     1.7-   (thunk :initform #'default-thunk :initarg :thunk :accessor cli-thunk :type function-lambda-expression)
     1.8+   (thunk :initform 'default-thunk :initarg :thunk :accessor cli-thunk :type symbol)
     1.9    (lock :initform nil :initarg :lock :accessor cli-lock-p :type boolean)
    1.10    (description :initarg :description :accessor cli-description :type string)
    1.11    (args :initform nil :initarg :args :accessor cli-cmd-args))
    1.12@@ -28,9 +28,14 @@
    1.13     (unless (stringp name) (setf name (format nil "~(~A~)" name)))
    1.14     (unless (vectorp cmds) (setf cmds (make-cmds cmds)))
    1.15     (unless (vectorp opts) (setf opts (make-opts opts)))
    1.16-    (when (symbolp thunk) (setf thunk (symbol-function thunk)))
    1.17     self))
    1.18 
    1.19+(defmethod make-load-form ((obj cli-cmd) &optional env)
    1.20+  (make-load-form-saving-slots 
    1.21+   obj 
    1.22+   :slot-names '(name opts cmds thunk lock description args)
    1.23+   :environment env))
    1.24+                               
    1.25 (defmethod print-object ((self cli-cmd) stream)
    1.26   (print-unreadable-object (self stream :type t)
    1.27     (format stream "~A :opts ~A :cmds ~A :args ~A"