- (main cl-launch:*arguments*)
- (simple-error (err)
- (bail (simple-condition-format-control err)
- (simple-condition-format-arguments err)))
- (error (err)
- (bail "~A" err)))))
+ (destructuring-bind (&optional a b &rest junk) args
+ (cond ((or (null a) junk)
+ (error "bad args"))
+ ((null b)
+ (format t "~{~C~}~%"
+ (list-iterator (iterate-fringe (parse-tree a)))))
+ (t
+ (format t "~:[no match~;match~]~%"
+ (same-iterators-p
+ (iterate-fringe (parse-tree a))
+ (iterate-fringe (parse-tree b)))))))
+ (simple-error (err)
+ (bail (simple-condition-format-control err)
+ (simple-condition-format-arguments err)))
+ (error (err)
+ (bail "~A" err)))
+ 0))
+
+#+cl-launch
+(cl-launch:quit (main (pathname-name (or (cl-launch:getenv "CL_LAUNCH_FILE")
+ *load-pathname*
+ "<unknown>"))
+ cl-launch:*arguments*))
+
+#+(and (not cl-launch) ecl)
+(ext:quit (main (ext:argv 0)
+ (loop for i from 1 below (ext:argc) collect (ext:argv i))))
+
+#+(and (not cl-launch) sbcl)
+(sb-ext:quit :unix-status (main (pathname-name *load-pathname*)
+ (cdr sb-ext:*posix-argv*)))