31 lines
482 B
Go
31 lines
482 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func commandsUsage() string {
|
|
return fmt.Sprintf(
|
|
`commands:
|
|
path %v
|
|
`, commandPathDescription)
|
|
}
|
|
|
|
func main() {
|
|
if len(os.Args) >= 2 {
|
|
switch os.Args[1] {
|
|
case "path":
|
|
commandPath(os.Args[1:])
|
|
default:
|
|
fmt.Printf("unknow command `%v`\n\n", os.Args[1])
|
|
fmt.Printf("%v", commandsUsage())
|
|
os.Exit(1)
|
|
}
|
|
} else {
|
|
fmt.Println("Personal scripts set written in Golang\n")
|
|
fmt.Printf("%v", commandsUsage())
|
|
}
|
|
|
|
}
|