feat: enhance CLI output with colorful and informative messages

This commit is contained in:
Yar Kravtsov
2025-05-24 10:13:00 +03:00
parent 1e2728fe33
commit 61a9cc8c88
10 changed files with 111 additions and 49 deletions

View File

@@ -9,10 +9,11 @@ import (
)
var rmCmd = &cobra.Command{
Use: "rm <file>",
Short: "Remove a file from lnk management",
Long: "Removes a symlink and restores the original file from the lnk repository.",
Args: cobra.ExactArgs(1),
Use: "rm <file>",
Short: "🗑️ Remove a file from lnk management",
Long: "Removes a symlink and restores the original file from the lnk repository.",
Args: cobra.ExactArgs(1),
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
filePath := args[0]
@@ -22,7 +23,9 @@ var rmCmd = &cobra.Command{
}
basename := filepath.Base(filePath)
fmt.Printf("Removed %s from lnk\n", basename)
fmt.Printf("🗑️ \033[1mRemoved %s from lnk\033[0m\n", basename)
fmt.Printf(" ↩️ \033[90m~/.config/lnk/%s\033[0m → \033[36m%s\033[0m\n", basename, filePath)
fmt.Printf(" 📄 Original file restored\n")
return nil
},
}