This commit is contained in:
2026-06-12 14:47:58 +08:00
commit edd950f38d
6 changed files with 74 additions and 0 deletions

20
path.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
)
var commandPathDescription = "list paths"
func commandPath(args []string) {
fs := flag.NewFlagSet("path", flag.ContinueOnError)
fs.Parse(args)
rawPath := os.Getenv("PATH")
paths := strings.Split(rawPath, string(os.PathListSeparator))
for _, item := range paths {
fmt.Println(item)
}
}