diff --git a/src/main.lisp b/src/main.lisp index 7e1d10f..08e15b9 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -286,6 +286,7 @@ (source (if type (parse-source-string-for-type type source) (parse-source-string source))) + (type (parse-cli-type (conn-type source))) (target (parse-target-string (second arguments)))) ;; some verbosity about the parsing "magic" diff --git a/src/package.lisp b/src/package.lisp index cd97ee2..6843552 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -476,6 +476,7 @@ ;; connection types / classes symbols for use in main #:connection + #:conn-type #:csv-connection #:fixed-connection #:copy-connection diff --git a/src/parsers/command-parser.lisp b/src/parsers/command-parser.lisp index e3fc25b..54f4d24 100644 --- a/src/parsers/command-parser.lisp +++ b/src/parsers/command-parser.lisp @@ -258,6 +258,7 @@ (defrule cli-type (or "csv" "fixed" + "copy" dbf-type-name "ixf" "sqlite" @@ -281,16 +282,18 @@ (loop :for field :in fields :append (parse (case type (:csv 'csv-source-fields) - (:fixed 'fixed-source-fields)) + (:fixed 'fixed-source-fields) + (:copy 'copy-source-fields)) field))) (defun parse-cli-options (type options) "Parse options as per the WITH clause when we get them from the CLI." (alexandria:alist-plist (loop :for option :in options - :collect (parse (case type + :collect (parse (ecase type (:csv 'csv-option) (:fixed 'fixed-option) + (:copy 'copy-option) (:dbf 'dbf-option) (:ixf 'ixf-option) (:sqlite 'sqlite-option)