mirror of
https://github.com/CosmicStar98/bedrocktool.git
synced 2024-06-01 20:35:14 +00:00
improve cli
This commit is contained in:
parent
fd70a47be1
commit
03ce586fb6
8
main.go
8
main.go
|
@ -110,7 +110,13 @@ func main() {
|
||||||
fmt.Printf("\t%s\t%s\n", name, cmd.Desc)
|
fmt.Printf("\t%s\t%s\n", name, cmd.Desc)
|
||||||
}
|
}
|
||||||
fmt.Printf("Use '%s <command>' to run a command\n", os.Args[0])
|
fmt.Printf("Use '%s <command>' to run a command\n", os.Args[0])
|
||||||
return
|
|
||||||
|
fmt.Printf("Input Command: ")
|
||||||
|
reader := bufio.NewReader(os.Stdin)
|
||||||
|
target, _ := reader.ReadString('\n')
|
||||||
|
r, _ := regexp.Compile(`[\n\r]`)
|
||||||
|
target = string(r.ReplaceAll([]byte(target), []byte("")))
|
||||||
|
os.Args = append(os.Args, target)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := cmds[os.Args[1]]
|
cmd := cmds[os.Args[1]]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user