init
This commit is contained in:
20
path.go
Normal file
20
path.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user