Commits

David Krentzlin committed 33eef82 Draft

updated processor to include fixes for command syntax

Comments (0)

Files changed (1)

mira.core/src/processor.lisp

 	   (cmd-opts      (command-line-options command))
 	   (first-arg     (car argument-list))
 	   (no-args-ok    (allow-no-args command)))
-      (if (and first-arg (stringp first-arg) (equal (string-downcase (car argument-list)) "help"))
+      (if (and first-arg (stringp first-arg) 
+	       (or
+		(equal (string-downcase (car argument-list)) "--help")
+		(equal (string-downcase (car argument-list)) "help")))
           (cmd-answer command-env (help command))
 	  (handler-case 
 	      (progn		
 		(multiple-value-bind (args options errors) (getopt argument-list cmd-opts)
-		  (if (or errors (and (not no-args-ok (not args))))
-		      (cmd-answer command-env (usage command))
-		      (apply cmd-closure command-env options args)))
-		(apply cmd-closure command-env nil argument-list))
-	     (error ()
+		  (let ((args (delete-if (lambda (e) (equal e "")) args)))
+		    (if (or errors (and (not no-args-ok) (not args)))
+			(cmd-answer command-env (usage command))
+			(apply cmd-closure command-env options args)))))
+	    (error ()
 	       (format t "Have an error~%")
 	       (cmd-answer command-env (usage command))))
 	  ))))
 	    (maybe/default (third option))
 	    (descr (fourth option)))
        (if maybe/default
-	   (format nil "~A [Default=~A] ~A" name maybe/default descr)
-	   (format nil "~A: ~A " name descr))))
+	   (format nil "--~A [Default=~A] ~A" name maybe/default descr)
+	   (format nil "--~A: ~A " name descr))))
    options))