fix: handle zone argument correctly
This commit is contained in:
parent
84bf3ffa50
commit
d26fabe8ef
|
@ -279,12 +279,14 @@ func EnsureDNSValueFlag(c *cli.Context) error {
|
||||||
|
|
||||||
// EnsureZoneArgument ensures a zone argument is present.
|
// EnsureZoneArgument ensures a zone argument is present.
|
||||||
func EnsureZoneArgument(c *cli.Context) (string, error) {
|
func EnsureZoneArgument(c *cli.Context) (string, error) {
|
||||||
var zone string
|
zone := c.Args().First()
|
||||||
if c.Args().First() == "" && !NoInput {
|
|
||||||
|
if zone == "" && !NoInput {
|
||||||
prompt := &survey.Input{
|
prompt := &survey.Input{
|
||||||
Message: "Specify a domain name zone",
|
Message: "Specify a domain name zone",
|
||||||
Default: "example.com",
|
Default: "example.com",
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := survey.AskOne(prompt, &zone); err != nil {
|
if err := survey.AskOne(prompt, &zone); err != nil {
|
||||||
return zone, err
|
return zone, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue