Skip to content

Commit

Permalink
Fix the #! script to have the same behaviour as the main binary execu…
Browse files Browse the repository at this point in the history
…table.
  • Loading branch information
dimitri committed Oct 9, 2013
1 parent 62c402b commit dc55962
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions pgloader.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,5 @@

(in-package #:pgloader)

(defparameter *opt-spec*
`((("help" #\h) :type boolean :documentation "show usage")
(("file" #\f) :type string :documentation "read commands from file")))

(defun main (argv)
"Entry point when building an executable image with buildapp"
(multiple-value-bind (options arguments)
(command-line-arguments:process-command-line-options *opt-spec* argv)
(declare (ignore arguments))
(destructuring-bind (&key help file) options

(when help
(command-line-arguments:show-option-help *opt-spec*)
(uiop:quit))

(run-command (slurp-file-into-string file))
(format t "~&")

(uiop:quit))))

;;; actually call the main function, too
(main (uiop:command-line-arguments))
(main SB-EXT:*POSIX-ARGV*)

0 comments on commit dc55962

Please sign in to comment.