Skip to content

Commit 80397cd

Browse files
committed
feat: Work on dists
1 parent 847b860 commit 80397cd

File tree

13 files changed

+129
-14
lines changed

13 files changed

+129
-14
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@ OPTIONS:
2828
-v, --verbose <INT> set verbosity from 0 to 5 [default: 3]
2929
3030
COMMANDS:
31-
build Build the executable
32-
dists List out all installed dists
33-
install Install packages
34-
install-deps Automatically install system dependencies
35-
uninstall Uninstall packages
36-
list List the registered system
31+
build Build the executable
32+
dists List out all installed dists
33+
info Display information about the current system(s)
34+
install Install packages
35+
install-deps Automatically install system dependencies
36+
install-dists Install dists
37+
list List the registered system
38+
status Display the state of the workspac
39+
uninstall Uninstall packages
3740
3841
AUTHORS:
3942
Jen-Chieh Shen <jcs090218@gmail.com>

cmds/core/dists.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;;; cmds/core/dists.lisp --- Build executable
1+
;;;; cmds/core/dists.lisp --- Print all dists info
22

33
;;; Commentary
44
;;

cmds/core/info.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;;; cmds/core/info.lisp --- Build executable
1+
;;;; cmds/core/info.lisp --- Print the system info
22

33
;;; Commentary
44
;;

cmds/core/install-deps.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;;; cmds/core/install-deps.lisp --- Build executable
1+
;;;; cmds/core/install-deps.lisp --- Install dependencies
22

33
;;; Commentary
44
;;

cmds/core/install-dists.lisp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
;;;; cmds/core/install-dists.lisp --- Build executable
2+
3+
;;; Commentary
4+
;;
5+
;; The `install-dists' command definition.
6+
;;
7+
8+
;;; Code
9+
10+
(defpackage qob-cli/install-dists
11+
(:use cl)
12+
(:export command))
13+
14+
(in-package :qob-cli/install-dists)
15+
16+
(defun options ()
17+
"Options for `install-dists' command."
18+
(list
19+
))
20+
21+
(defun handler (cmd)
22+
"Handler for `install-dists' command."
23+
(qob-cli:call-script "core/install-dists" cmd))
24+
25+
(defun command ()
26+
"The `install-dists' command."
27+
(clingon:make-command
28+
:name "install-dists"
29+
:description "Install dists"
30+
:usage "[names..]"
31+
:options (options)
32+
:handler #'handler))
33+
34+
;;; End of cmds/core/install-dists.lisp

cmds/core/status.lisp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
;;;; cmds/core/status.lisp --- Print the workspace status
2+
3+
;;; Commentary
4+
;;
5+
;; The `status' command definition.
6+
;;
7+
8+
;;; Code
9+
10+
(defpackage qob-cli/status
11+
(:use cl)
12+
(:export command))
13+
14+
(in-package :qob-cli/status)
15+
16+
(defun options ()
17+
"Options for `status' command."
18+
(list ))
19+
20+
(defun handler (cmd)
21+
"Handler for `status' command."
22+
(qob-cli:call-script "core/status" cmd))
23+
24+
(defun command ()
25+
"The `status' command."
26+
(clingon:make-command
27+
:name "status"
28+
:description "Display the state of the workspac"
29+
:options (options)
30+
:handler #'handler))
31+
32+
;;; End of cmds/core/status.lisp

cmds/core/uninstall.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;;; cmds/core/uninstall.lisp --- Build executable
1+
;;;; cmds/core/uninstall.lisp --- Uninstall dependencies
22

33
;;; Commentary
44
;;

cmds/qob.lisp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
,(qob-cli/info:command)
6161
,(qob-cli/install:command)
6262
,(qob-cli/install-deps:command)
63-
,(qob-cli/uninstall:command)
64-
,(qob-cli/list:command))))
63+
,(qob-cli/install-dists:command)
64+
,(qob-cli/list:command)
65+
,(qob-cli/status:command)
66+
,(qob-cli/uninstall:command))))
6567

6668
;;; End of cmds/qob.lisp

lisp/core/info.lisp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
(defun qob-info--print-system (name system)
1515
"Print the SYSTEM info."
16+
(qob-println "")
1617
(let ((author (asdf:system-author system))
1718
(maintainer (asdf:system-maintainer system))
1819
(version (asdf:component-version system))
@@ -21,7 +22,7 @@
2122
(license (asdf:system-license system))
2223
(depends-on (asdf:system-depends-on system)))
2324
(qob-println "~A (~A) | deps: ~A"
24-
(qob-ansi-green name)
25+
(qob-ansi-green (string-downcase name))
2526
(qob-ansi-yellow version)
2627
(qob-ansi-cyan (length depends-on)))
2728
(when description

lisp/core/install-dists.lisp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
;;;; lisp/core/install-dists.lisp --- Install dists
2+
3+
;;; Commentary
4+
;;
5+
;; Command use to install dists,
6+
;;
7+
;; $ qob install-dists [names..]
8+
;;
9+
10+
;;; Code
11+
12+
(qob-init-ql)
13+
14+
(let ((names qob-args))
15+
(cond ((zerop (length names))
16+
(qob-help "core/install-dists"))
17+
(t
18+
(dolist (name names)
19+
(ql-dist:install-dist name :prompt nil)))))
20+
21+
;;; End of lisp/core/install-dists.lisp

lisp/core/status.lisp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
;;;; lisp/core/status.lisp --- Print the current workspace status
2+
3+
;;; Commentary
4+
;;
5+
;; Command use to print the workspace statu,
6+
;;
7+
;; $ qob status
8+
;;
9+
10+
;;; Code
11+
12+
(qob-init-asds)
13+
14+
;; TODO: ..
15+
16+
;;; End of lisp/core/status.lisp

lisp/help/core/info

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
💡 You need to specify the systems you want to print the info:
3+
4+
$ qob info <system-1> <system-2> ...

qob-cli.asd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
(:file "cmds/core/info")
1717
(:file "cmds/core/install")
1818
(:file "cmds/core/install-deps")
19-
(:file "cmds/core/uninstall")
19+
(:file "cmds/core/install-dists")
2020
(:file "cmds/core/list")
21+
(:file "cmds/core/status")
22+
(:file "cmds/core/uninstall")
2123
(:file "cmds/qob")
2224
;; Program
2325
(:file "src/main"))

0 commit comments

Comments
 (0)