From 1535baa68bd2dd19526f60e3d0172175de4ac7da Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Sun, 19 Jan 2025 19:56:02 +0000 Subject: [PATCH] Factor out CLI into its own module --- examples/inventory.scm | 3 +-- modules/ordo.scm | 11 ----------- modules/ordo/cli.scm | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 modules/ordo/cli.scm diff --git a/examples/inventory.scm b/examples/inventory.scm index 00bee3e..01c0a25 100644 --- a/examples/inventory.scm +++ b/examples/inventory.scm @@ -1,5 +1,4 @@ -(use-modules (ordo inventory) - (ordo connection)) +(use-modules (ordo)) (add-host! "little-rascal" (local-connection) diff --git a/modules/ordo.scm b/modules/ordo.scm index efd874f..b978821 100644 --- a/modules/ordo.scm +++ b/modules/ordo.scm @@ -1,5 +1,4 @@ (define-module (ordo) - #:declarative? #f #:use-module (ice-9 match) #:use-module (ordo playbook) #:use-module (ordo play) @@ -9,14 +8,4 @@ #:use-module (ordo inventory) #:use-module (ordo vars) #:use-module (ordo logger) - #:export (main) #:re-export (add-host! local-connection ssh-connection run playbook play task handler $)) - -(define (main args) - (match-let (((_ inventory-path playbook-path) args)) - (setup-logging #:level 'DEBUG) - (init-command-line-vars! '()) - (load inventory-path) - (let ((playbook (load playbook-path))) - (run-playbook playbook))) - (quit)) diff --git a/modules/ordo/cli.scm b/modules/ordo/cli.scm new file mode 100644 index 0000000..3d4497c --- /dev/null +++ b/modules/ordo/cli.scm @@ -0,0 +1,16 @@ +(define-module (ordo cli) + #:use-module (ice-9 match) + #:use-module (ordo logger) + #:use-module (ordo vars) + #:use-module (ordo playbook) + #:declarative? #f + #:export (main)) + +(define (main args) + (match-let (((_ inventory-path playbook-path) args)) + (setup-logging #:level 'DEBUG) + (init-command-line-vars! '()) + (load inventory-path) + ;; (let ((playbook (load playbook-path))) + ;; (run-playbook playbook)) + (quit)))