mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Show usage and help when the command line options are not recognized.
This commit is contained in:
parent
e8fcb15c27
commit
be4cc804c0
@ -83,11 +83,22 @@
|
||||
(t
|
||||
logfile)))
|
||||
|
||||
(defun usage (argv &key quit)
|
||||
"Show usage then QUIT if asked to."
|
||||
(format t "~a [ option ... ] command-file ..." (first argv))
|
||||
(command-line-arguments:show-option-help *opt-spec*)
|
||||
(when quit (uiop:quit)))
|
||||
|
||||
(defun main (argv)
|
||||
"Entry point when building an executable image with buildapp"
|
||||
(let ((args (rest argv)))
|
||||
(multiple-value-bind (options arguments)
|
||||
(command-line-arguments:process-command-line-options *opt-spec* args)
|
||||
(handler-case
|
||||
(command-line-arguments:process-command-line-options *opt-spec* args)
|
||||
(condition (e)
|
||||
;; print out the usage, whatever happens here
|
||||
(declare (ignore e))
|
||||
(usage argv :quit t)))
|
||||
|
||||
(destructuring-bind (&key help version quiet verbose debug logfile
|
||||
list-encodings upgrade-config load
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user