1
0
mirror of https://github.com/smallstep/cli.git synced 2026-10-24 11:19:19 +03:00

get-hosts -> hosts

* pass nil arg to offline as a fill-in for now
This commit is contained in:
max furman
2019-11-20 14:29:40 -08:00
parent 8a88605be6
commit 8988d4fc20
3 changed files with 9 additions and 9 deletions

View File

@@ -10,13 +10,13 @@ import (
"github.com/urfave/cli"
)
func getHostsCommand() cli.Command {
func hostsCommand() cli.Command {
return cli.Command{
Name: "get-hosts",
Action: command.ActionFunc(getHostsAction),
Name: "hosts",
Action: command.ActionFunc(hostsAction),
Usage: "returns a list of all valid hosts",
UsageText: `**step ssh get-hosts**`,
Description: `**step ssh get-hosts** returns a list of valid hosts for SSH.
UsageText: `**step ssh hosts**`,
Description: `**step ssh hosts** returns a list of valid hosts for SSH.
This command returns a zero exit status then the server exists, it will return 1
otherwise.
@@ -27,7 +27,7 @@ otherwise.
Get a list of valid hosts for SSH:
'''
$ step ssh get-hosts
$ step ssh hosts
'''`,
Flags: []cli.Flag{
flags.CaURL,
@@ -38,7 +38,7 @@ $ step ssh get-hosts
}
}
func getHostsAction(ctx *cli.Context) error {
func hostsAction(ctx *cli.Context) error {
if err := errs.NumberOfArguments(ctx, 0); err != nil {
return err
}

View File

@@ -50,7 +50,7 @@ $ step ssh certificate --host internal.example.com ssh_host_ecdsa_key
proxyCommand(),
proxycommandCommand(),
checkHostCommand(),
getHostsCommand(),
hostsCommand(),
renewCommand(),
revokeCommand(),
rekeyCommand(),

View File

@@ -411,7 +411,7 @@ func (c *OfflineCA) SSHCheckHost(principal string) (*api.SSHCheckPrincipalRespon
// SSHGetHosts is a wrapper on top of the CheckSSHHost method. It returns an
// api.SSHCheckPrincipalResponse.
func (c *OfflineCA) SSHGetHosts() (*api.SSHGetHostsResponse, error) {
hosts, err := c.authority.GetSSHHosts()
hosts, err := c.authority.GetSSHHosts(nil)
if err != nil {
return nil, err
}