[cmd] remove unnecessary exports

This commit is contained in:
Rasmus Moorats 2018-08-29 17:50:02 +03:00
parent a7decc00fb
commit 8a561cf920
5 changed files with 20 additions and 20 deletions

View file

@ -24,20 +24,20 @@ import (
"gitlab.com/neonsea/iopshell/internal/setting"
)
var Auth = cmd.Command{
var auth = cmd.Command{
Name: "auth",
UsageText: "auth <user> <pass>",
Description: "Authenticates as <user> with <pass>",
Action: auth,
Action: authRun,
MinArg: 3,
MaxArg: 3,
}
func auth(param []string) {
func authRun(param []string) {
setting.Vars.Conn.Call("session", "login", map[string]interface{}{"username": param[0],
"password": param[1]})
}
func init() {
Auth.Register()
auth.Register()
}

View file

@ -27,15 +27,15 @@ import (
"gitlab.com/neonsea/iopshell/internal/textmutate"
)
var Call = cmd.Command{
var call = cmd.Command{
Name: "call",
UsageText: "call <path> <method> [message]",
Description: "Calls <method> from <path>. Additionally, [message] is passed to the call if set",
Action: call,
Action: callRun,
MinArg: 3,
}
func call(param []string) {
func callRun(param []string) {
if len(param) == 2 {
setting.Vars.Conn.Call(param[0], param[1], make(map[string]interface{}))
} else {
@ -46,5 +46,5 @@ func call(param []string) {
}
func init() {
Call.Register()
call.Register()
}

View file

@ -24,15 +24,15 @@ import (
"gitlab.com/neonsea/iopshell/internal/setting"
)
var Connect = cmd.Command{
var connect = cmd.Command{
Name: "connect",
UsageText: "connect [host]",
Description: "Connects to [host]. If none specified, uses values from config",
Action: connect,
Action: connectRun,
MaxArg: 2,
}
func connect(param []string) {
func connectRun(param []string) {
var addr string
if len(param) == 0 {
addr = setting.Host
@ -43,5 +43,5 @@ func connect(param []string) {
}
func init() {
Connect.Register()
connect.Register()
}

View file

@ -24,18 +24,18 @@ import (
"gitlab.com/neonsea/iopshell/internal/setting"
)
var Disconnect = cmd.Command{
var disconnect = cmd.Command{
Name: "disconnect",
UsageText: "disconnect",
Description: "Disconnects from the currently connected host",
Action: disconnect,
Action: disconnectRun,
MaxArg: 1,
}
func disconnect(param []string) {
func disconnectRun(param []string) {
setting.Cmd <- []string{"disconnect"}
}
func init() {
Disconnect.Register()
disconnect.Register()
}

View file

@ -25,15 +25,15 @@ import (
"gitlab.com/neonsea/iopshell/internal/cmd"
)
var Help = cmd.Command{
var help = cmd.Command{
Name: "help",
UsageText: "help [command]",
Description: "Prints some help info. If [command] is specified, prints info on that",
Action: help,
Action: helpRun,
MaxArg: 2,
}
func help(param []string) {
func helpRun(param []string) {
if len(param) == 0 {
fmt.Println("Available commands:")
for cmd := range cmd.CommandList {
@ -52,5 +52,5 @@ func help(param []string) {
}
func init() {
Help.Register()
help.Register()
}