Codebase list cafeobj / baebaf6
Improve output of 'set' command. tswd 4 years ago
1 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
266266 (defun show-modes (flg)
267267 (if (eq flg t)
268268 (let ((*print-line-limit* 62))
269 (format t "~%switch~24Tvalue~%--------------------------------------------------------------")
269 (format t "~%switch~24Tvalue~%========================================================")
270270 (dolist (sw *chaos-switches*)
271271 (unless (chaos-switch-hidden sw)
272272 (show-mode sw))))
273273 (let ((sw flg))
274274 (if (or (equal sw '(".")) (null sw))
275275 (show-modes t)
276 (let ((which (car flg))
276 (let ((which (car flg))
277277 (sub (cdr flg))
278278 (found nil)
279279 (cand nil))
280 (dolist (sw *chaos-switches*)
280 (dolist (sw *chaos-switches*)
281281 (block next
282282 (let ((key (chaos-switch-key sw)))
283283 (when (eq key :comment) (return-from next nil))
284284 (when (atom key) (setq key (list key)))
285285 (when (member which key :test #'equal)
286 (setq cand sw)
286 ;; (setq cand sw)
287 (push sw cand)
287288 (let ((opt (chaos-switch-subkey sw)))
288289 (when (equal opt (firstn sub (length opt)))
289 (setq found sw)
290 (setq cand nil)
291 (return)))))))
292 (unless (or found cand)
290 (setq found sw)))))))
291 (unless (or found cand)
293292 (with-output-chaos-warning ()
294293 (format t "unknown switch ~a" flg)
295294 (return-from show-modes nil)))
296 (if found
295 (if found
297296 (show-mode found)
298 (show-mode cand)))))))
297 (dolist (sw cand)
298 (show-mode sw))))))))
299299
300300 (defun show-mode (switch)
301301 (let ((name (chaos-switch-key switch))
305305 (cond ((eq name :comment)
306306 (format t "~%~a" (second switch)))
307307 ((equal name "libpath")
308 (format t "~%libpath~24T= ~{~a~^:~}" value))
308 (format t "~%libpath~24T ~{~a~^:~}" value))
309309 (t (when (atom name) (setq name (list name)))
310310 (if (eq type 'parity)
311311 (format t "~%~{~a~^|~a~} ~{~^ ~a~} ~24T~:[off~;on~]" name option value)
312 (progn (format t "~%~{~a~^|~a~} ~{~^ ~a~} ~24T= " name option)
312 (progn (format t "~%~{~a~^|~a~} ~{~^ ~a~} ~24T" name option)
313313 (if value
314314 (print-chaos-object value)
315315 (princ "not specified"))))))))