forked from toolshed/abra
feat: server add command
Interacts with and stores infomaton in the docker store at ~/.docker Equivalent to docker context add
This commit is contained in:
@ -58,6 +58,18 @@ var serverAddCommand = &cli.Command{
|
||||
Usage: "Add a server, reachable on <host>.",
|
||||
ArgsUsage: "<host> [<user>] [<port>]",
|
||||
Description: "[<user>], [<port>] SSH connection details",
|
||||
Action: func(c *cli.Context) error {
|
||||
arg_len := c.Args().Len()
|
||||
args := c.Args().Slice()
|
||||
if arg_len < 3 {
|
||||
args = append(args, make([]string, 3-arg_len)...)
|
||||
}
|
||||
if err := client.CreateContext(args[0], args[1], args[2]); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
fmt.Println(args[0])
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
var serverNewCommand = &cli.Command{
|
||||
|
Reference in New Issue
Block a user