refactor: Rename sydnix → sydnix-cli

This commit is contained in:
Madeleine Sydney
2025-01-14 20:24:07 -07:00
parent 29fd94f9e2
commit 0e9bad81ee
20 changed files with 55 additions and 57 deletions

View 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))