Changeset 159
- Timestamp:
- 03/05/08 05:39:54 (17 years ago)
- Location:
- cl-darcs/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified cl-darcs/trunk/cmdline.lisp ¶
r158 r159 27 27 "Turn a command symbol into a function symbol." 28 28 (intern (format nil "CMD-~A" command) :darcs))) 29 30 (define-condition invalid-arguments (simple-error)31 ())32 29 33 30 (defun handle-command-line (argv) -
TabularUnified cl-darcs/trunk/getopt.lisp ¶
r158 r159 16 16 17 17 (in-package :darcs) 18 19 (define-condition invalid-arguments (simple-error) 20 ()) 18 21 19 22 ;; The option struct describes a command line option. … … 54 57 (if (option-arg opt) 55 58 (if (or no-argument (null args)) 56 (error "Option ~A requires an argument." arg) 59 (error 'invalid-arguments 60 :format-control "Option ~A requires an argument." 61 :format-arguments (list arg)) 57 62 (pop args)) 58 63 t)) … … 81 86 (option (find long-option options :key #'option-long :test #'string=))) 82 87 (unless option 83 (error "Unknown long option ~S (none of ~{~S ~})." arg (mapcar #'option-long options))) 88 (error 'invalid-arguments 89 :format-control "Unknown long option ~S (none of ~{~S ~})." 90 :format-arguments (list arg (mapcar #'option-long options)))) 84 91 (maybe-get-argument arg option))) 85 92 … … 94 101 (option (find letter options :key #'option-short))) 95 102 (unless option 96 (error "Unknown option ~A." letter)) 103 (error 'invalid-arguments 104 :format-control "Unknown option ~A." 105 :format-arguments (list letter))) 97 106 ;; Only the last short option can have an argument. 98 107 (maybe-get-argument letter option
Note: See TracChangeset
for help on using the changeset viewer.