From 46b7078d2348715b96b91c391dbd83a61ac06766 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Thu, 24 Oct 2024 00:14:51 +0800 Subject: [PATCH] prepare uninstall --- cmds/core/uninstall.lisp | 33 +++++++++++++++++++++++++++++++++ cmds/qob.lisp | 1 + lisp/core/uninstall.lisp | 29 +++++++++++++++++++++++++++++ qob-cli.asd | 1 + 4 files changed, 64 insertions(+) create mode 100644 cmds/core/uninstall.lisp create mode 100644 lisp/core/uninstall.lisp diff --git a/cmds/core/uninstall.lisp b/cmds/core/uninstall.lisp new file mode 100644 index 0000000..75c54b3 --- /dev/null +++ b/cmds/core/uninstall.lisp @@ -0,0 +1,33 @@ +;;;; cmds/core/uninstall.lisp --- Build executable + +;;; Commentary +;; +;; The `uninstall' command definition. +;; + +;;; Code + +(defpackage qob-cli/uninstall + (:use cl) + (:export command)) + +(in-package :qob-cli/uninstall) + +(defun options () + "Options for `uninstall' command." + (list )) + +(defun handler (cmd) + "Handler for `uninstall' command." + (qob-cli:call-script "core/uninstall" cmd)) + +(defun command () + "The `uninstall' command." + (clingon:make-command + :name "uninstall" + :description "Uninstall packages" + :usage "[names..]" + :options (options) + :handler #'handler)) + +;;; End of cmds/core/uninstall.lisp diff --git a/cmds/qob.lisp b/cmds/qob.lisp index d7cba38..216d197 100644 --- a/cmds/qob.lisp +++ b/cmds/qob.lisp @@ -59,6 +59,7 @@ ,(qob-cli/dists:command) ,(qob-cli/install:command) ,(qob-cli/install-deps:command) + ,(qob-cli/uninstall:command) ,(qob-cli/list:command)))) ;;; End of cmds/qob.lisp diff --git a/lisp/core/uninstall.lisp b/lisp/core/uninstall.lisp new file mode 100644 index 0000000..55bbb38 --- /dev/null +++ b/lisp/core/uninstall.lisp @@ -0,0 +1,29 @@ +;;;; lisp/core/uninstall.lisp --- Uninstall systems + +;;; Commentary +;; +;; Command use to uninstall systems, +;; +;; $ qob uninstall [names..] +;; +;; +;; Optional arguments: +;; +;; [names..] name of the system(s) to uninstall +;; + +;;; Code + +(qob-init-ql) + +(qob-load "shared") + +(let ((names qob-args)) + (cond ((zerop (length names)) + (qob-help "core/uninstall")) + (t + ;; TODO: .. + ;;(qob-install-systems names) + ))) + +;;; End of lisp/core/uninstall.lisp diff --git a/qob-cli.asd b/qob-cli.asd index 2719d5d..22d9d55 100644 --- a/qob-cli.asd +++ b/qob-cli.asd @@ -14,6 +14,7 @@ (:file "cmds/core/dists") (:file "cmds/core/install") (:file "cmds/core/install-deps") + (:file "cmds/core/uninstall") (:file "cmds/core/list") (:file "cmds/qob") ;; Program