mirror of
https://github.com/yarlson/lnk.git
synced 2025-09-07 18:40:40 +02:00
feat: enhance CLI output with colorful and informative messages
This commit is contained in:
13
cmd/rm.go
13
cmd/rm.go
@@ -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
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user