12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package Commands
- import (
- "golang.org/x/crypto/ssh/terminal"
- "git.swzry.com/NSMCServerLauncher/Utils"
- "path"
- "fmt"
- )
- func CMD_pwd_C(args []string, term *terminal.Terminal,context *Utils.UserContextType) {
- term.Write([]byte("PWD: " + context.PWD + "\n"))
- }
- func CMD_cd_C(args []string, term *terminal.Terminal,context *Utils.UserContextType) {
- stargs := Utils.RestrictQuotedArgs(args)
- fmt.Println(stargs)
- switch len(stargs) {
- case 0:
- term.Write([]byte("PWD: " + context.PWD + "\n"))
- break
- default:
- tpath := "/"
- if stargs[0][0] == '/'{
- tpath = path.Join("/",stargs[0][1:])
- }else{
- tpath = path.Join(context.PWD,stargs[0])
- }
-
- context.PWD = tpath
- //term.Write([]byte("PWD: " + context.PWD + "\n"))
- // TODO: Change PWD
- }
- }
- func CMD_mcstat_C(args []string, term *terminal.Terminal,context *Utils.UserContextType) {
- term.Write([]byte("Minecraft Server Not Running."))
- // TODO: Minecraft Status Display
- }
- func CMD_sz_C(args []string, term *terminal.Terminal,context *Utils.UserContextType) {
- term.Write([]byte("Not Support Yet."))
- // TODO: ZMODEM Transfer
- }
|