Danp2 / au3WebDriver

Web Driver UDF for AutoIt
MIT License
107 stars 21 forks source link

Request of function "_WD_GetUDFVersion()" which returns $__WDVERSION #510

Closed Sven-Seyfert closed 6 months ago

Sven-Seyfert commented 6 months ago

Feature request

Is your feature request related to a problem? Please describe

In this forum thread / discussion a user was asking for an explicit function to get the current UDF version.

@Danp2 : You did already mention that you don't see the need for it.

[...] At this time, I don't see the need to add this function to the UDF because

  • the functionality already exists, albeit in a different format
  • there's nothing preventing you from creating your own wrapper function

But indeed it would help to reduce the "switch cases" in function _WD_Option() which would be a nice side effect. Also in terms of consistency I would go this way. See functions _WD_IsLatestRelease() and _WD_GetWebDriverVersion().

⚠ It's totally fine for me if you say "no" and close the issue. Otherwise, I would provide a PR for this.

Describe the solution you'd like

; Variant 1
Func _WD_GetUDFVersion()
    Return $__WDVERSION
EndFunc

Describe alternatives you've considered

; Variant 2
Func _WD_GetUDFVersion()
    Return _WD_Option('version')
EndFunc

Additional context

See the conversation in the thread .

Influences and relationship to other functionality

Maybe, in case of "Variant 1" will be accepted, the function _WD_Option() will get reduced by the "switch case" "version". I see no other impact.

Best regards Sven

Danp2 commented 6 months ago

But indeed it would help to reduce the "switch cases" in function _WD_Option() which would be a nice side effect.

Maybe, in case of "Variant 1" will be accepted, the function _WD_Option() will get reduced by the "switch case" "version". I see no other impact.

Removing this functionality from _WD_Option would be a script breaking change for any existing scripts that use this option, so I see no good reason for creating such a scenario.

Sven-Seyfert commented 6 months ago

Understood 🤔 . I am not sure of course, but I would bet there is almost no one who uses _WD_Option("version"). Anyhow, is it worth to go with "Variant 2" and proceed here or do you prefer to "... let us close this issue"?

Sven-Seyfert commented 6 months ago

To be honest, I rethinked the whole approach and believe it's not necessary to add another function which is simply a wrapper function of another one. Like @Danp2 initially said:

[...] At this time, I don't see the need to add this function to the UDF because

  • the functionality already exists, albeit in a different format
  • there's nothing preventing you from creating your own wrapper function

=> If it's fine for you two, @Danp2 and @mlipok, let us close the issue here. => In case it's still important for the author of the idea, he/she could open an GitHub issue on his/her own.

Danp2 commented 6 months ago

@Sven-Seyfert Glad you finally came to your senses. 😝