roswell.util:config returns nil when the value is empty.

This commit is contained in:
SANO Masatoshi 2017-04-19 10:05:01 +02:00
parent 9d33814fc1
commit 90980a217c
2 changed files with 3 additions and 2 deletions

View file

@ -56,7 +56,7 @@ exec ros +R +Q -m roswell -L sbcl-bin -- $0 "$@"
(setf conf (config conf (second argv) (third argv)))
(save-config path conf) 0)
((and (equal (first argv) "show") (= 2 len))
(format t "~A~%" (third (find (second argv) conf :test 'equal :key #'first))) 0)
(format t "~A~%" (or (third (find (second argv) conf :test 'equal :key #'first)) "")) 0)
((= 2 len)
(setf conf (config conf (first argv) (second argv)))
(save-config path conf) 0)

View file

@ -115,7 +115,8 @@
(roswell:roswell `("roswell-internal-use" "core-extention" ,impl) :string t))
(defun config (c)
(roswell:roswell `("config" "show" ,c) :string t))
(let ((result (roswell:roswell `("config" "show" ,c) :string t)))
(unless (zerop (length result)) result)))
(defun (setf config) (val item)
(roswell:roswell `("config" "set" ,item ,val) :string t)