1
0
mirror of https://github.com/smallstep/cli.git synced 2025-08-09 03:22:43 +03:00

Switch to --verbose

This commit is contained in:
Carl Tashian
2021-04-13 15:54:42 -07:00
parent 039e718a74
commit 8eead2a82d

View File

@@ -25,11 +25,11 @@ func checkHostCommand() cli.Command {
Usage: "checks if a certificate has been issued for a host",
UsageText: `**step ssh check-host** <hostname>
[**--ca-url**=<uri>] [**--root**=<file>]
[**--offline**] [**--ca-config**=<path>] [**--quiet**]`,
[**--offline**] [**--ca-config**=<path>] [**--verbose,-v**]`,
Description: `**step ssh check-host** checks if a certificate has been issued for a host.
This command prints "true" and returns a zero exit status if the host has a certificate.
Otherwise, it prints "false" and returns 1.
This command returns a zero exit status if the host has a certificate.
Otherwise, it returns 1.
## POSITIONAL ARGUMENTS
@@ -48,15 +48,15 @@ $ step ssh check-host internal.smallstep.com
flags.Offline,
flags.CaConfig,
cli.BoolFlag{
Name: "quiet",
Usage: `Silently return an exit code.`,
Name: "verbose, v",
Usage: `Return "true" or "false" in the terminal.`,
},
},
}
}
func checkHostAction(ctx *cli.Context) error {
isQuiet := ctx.Bool("quiet")
isVerbose := ctx.Bool("verbose")
if err := errs.NumberOfArguments(ctx, 1); err != nil {
return err
@@ -102,7 +102,7 @@ func checkHostAction(ctx *cli.Context) error {
"error checking ssh host eligibility")
}
if !isQuiet {
if isVerbose {
fmt.Println(resp.Exists)
}
if !resp.Exists {