init
This commit is contained in:
30
main.go
Normal file
30
main.go
Normal file
@@ -0,0 +1,30 @@
|
||||
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())
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user