commit 6fecd17
chld
·
2026-02-07 04:19:54 +0000 UTC
parent 9e1518a
multi package support in ld and colors
1 files changed,
+22,
-14
M
main.go
M
main.go
+22,
-14
1@@ -52,22 +52,30 @@ func main() {
2
3 switch act {
4 case "ld":
5- dgr.Msg("dependencies of package ", pkgs[0], ":")
6- x, _ := dgr.FindPkg(pkgs[0])
7- file, _ := os.ReadFile(filepath.Join(x, "deps"))
8+ dgre.VC("DTR_DIR")
9+ if len(pkgs) < 1 {
10+ help()
11+ os.Exit(1)
12+ }
13+
14+ for i := range len(pkgs) {
15+ dgr.Msg("dependencies of package \033[m\033[33m", pkgs[i], "\033[m:")
16+ x, _ := dgr.FindPkg(pkgs[i])
17+ file, _ := os.ReadFile(filepath.Join(x, "deps"))
18
19- f := strings.Fields(string(file))
20- var a int
21- for a < len(f) {
22- if strings.Contains(f[a], ".") {
23- fmt.Println(strings.ReplaceAll(f[a], ".", ""), "(build time)")
24- } else if strings.Contains(f[a], "/") {
25- fmt.Println(strings.ReplaceAll(f[a], "/", ""), "(link time)")
26- } else if strings.Contains(f[a], ">") {
27- fmt.Println(strings.ReplaceAll(f[a], ">", ""), "(runtime)")
28+ f := strings.Fields(string(file))
29+ var a int
30+ for a < len(f) {
31+ if strings.Contains(f[a], ".") {
32+ fmt.Printf("\033[1m%s \033[m[%s]\n", strings.ReplaceAll(f[a], ".", ""), "build time")
33+ } else if strings.Contains(f[a], "/") {
34+ fmt.Printf("\033[1m%s \033[m[%s]\n", strings.ReplaceAll(f[a], "/", ""), "link time")
35+ } else if strings.Contains(f[a], ">") {
36+ fmt.Printf("\033[1m%s \033[m[%s]\n", strings.ReplaceAll(f[a], ">", ""), "runtime")
37+ }
38+ a++
39+ continue
40 }
41- a++
42- continue
43 }
44 case "s":
45 dgr.Msg("cloning", "codeberg.org/derivelinux/ports")