refactor: Rename sydnix → sydnix-cli
This commit is contained in:
25
scripts/sydnix-cli/src/sydnix_cli/main.clj
Executable file
25
scripts/sydnix-cli/src/sydnix_cli/main.clj
Executable file
@@ -0,0 +1,25 @@
|
||||
(ns sydnix-cli.main
|
||||
(:require
|
||||
[babashka.cli :as cli]
|
||||
[sydnix-cli.cli-table :refer [*cli-table]]
|
||||
[sydnix-cli.commands.help :as cmd-help :refer [adorn-with-help-option*]]
|
||||
[sydnix-cli.commands.rebuild :as cmd-rebuild]
|
||||
[sydnix-cli.commands.status :as cmd-status]
|
||||
[sydnix-cli.commands.util :as cmd-util])
|
||||
(:gen-class))
|
||||
|
||||
(def real-cli-table
|
||||
(map adorn-with-help-option*
|
||||
(concat cmd-status/commands
|
||||
cmd-rebuild/commands
|
||||
cmd-util/commands
|
||||
[cmd-help/command
|
||||
;; Show help when no other command matches.
|
||||
(assoc cmd-help/command :cmds [])])))
|
||||
|
||||
(defn -main [& args]
|
||||
(reset! *cli-table real-cli-table)
|
||||
(cli/dispatch @*cli-table args)
|
||||
;; Process may hang without this form. D:{
|
||||
;; https://github.com/babashka/process?tab=readme-ov-file#script-termination
|
||||
(shutdown-agents))
|
||||
Reference in New Issue
Block a user