commands

package
v0.0.0-...-ce713e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package commands contains all the functions for CLI commands, such as listing, adding or deleting SSH connections. See an example of an integration with the CLI app :

  app.Commands = []cli.Command{
		{
			Name:    "list",
			Aliases: []string{"l"},
			Usage:   "list all SSH connections",
			Action: func(c *cli.Context) error {
				return commands.ListConnections(c)
			},
		},
	}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConnection

func AddConnection(c *cli.Context) (err error)

AddConnection is a CLI command that adds a connection into user's book. It is called when the "ssh-book add" command is triggered by the user.

func Connect

func Connect(c *cli.Context) error

Connect is a CLI command that opens a connection stored inside user's book. It is called when the "ssh-book connect" command is triggered by the user.

func ListConnections

func ListConnections(c *cli.Context) error

ListConnections is a CLI command that lists all the saved connections in user's book. It is called when the "ssh-book list" command is triggered by the user.

func RemoveConnection

func RemoveConnection(c *cli.Context) error

RemoveConnection is a CLI command that removes a connection from user's book. It is called when the "ssh-book remove" command is triggered by the user.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL