fix: handle zone argument correctly

This commit is contained in:
decentral1se 2022-01-01 21:34:21 +01:00
parent 84bf3ffa50
commit d26fabe8ef
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 4 additions and 2 deletions

View File

@ -279,12 +279,14 @@ func EnsureDNSValueFlag(c *cli.Context) error {
// EnsureZoneArgument ensures a zone argument is present.
func EnsureZoneArgument(c *cli.Context) (string, error) {
var zone string
if c.Args().First() == "" && !NoInput {
zone := c.Args().First()
if zone == "" && !NoInput {
prompt := &survey.Input{
Message: "Specify a domain name zone",
Default: "example.com",
}
if err := survey.AskOne(prompt, &zone); err != nil {
return zone, err
}