refactor: name to match logic
This commit is contained in:
		| @ -84,3 +84,23 @@ func EnsureDNSValueFlag(c *cli.Context) error { | ||||
| 
 | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // EnsureZoneArgument ensures a zone argument is present. | ||||
| func EnsureZoneArgument(c *cli.Context) (string, error) { | ||||
| 	var zone string | ||||
| 	if c.Args().First() == "" && !NoInput { | ||||
| 		prompt := &survey.Input{ | ||||
| 			Message: "Specify a domain name zone", | ||||
| 			Default: "example.com", | ||||
| 		} | ||||
| 		if err := survey.AskOne(prompt, &zone); err != nil { | ||||
| 			return zone, err | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	if zone == "" { | ||||
| 		ShowSubcommandHelpAndError(c, errors.New("no zone value provided")) | ||||
| 	} | ||||
| 
 | ||||
| 	return zone, nil | ||||
| } | ||||
		Reference in New Issue
	
	Block a user