• is it possible to programmatically access Tcllib and Tklib versions?

    From Mark Summerfield@21:1/5 to All on Wed Jun 26 07:40:00 2024
    For a --help option or for an About box I like to show lib versions.
    This is easy for Tcl and for Tk, e.g.

    "Tcl v$::tcl_patchLevel/Tk v$::tk_version"

    But I can't see how to get the versions of Tcllib and Tklib. Is this
    possible?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Mark Summerfield on Wed Jun 26 16:31:58 2024
    Mark Summerfield <[email protected]> wrote:
    For a --help option or for an About box I like to show lib versions.
    This is easy for Tcl and for Tk, e.g.

    "Tcl v$::tcl_patchLevel/Tk v$::tk_version"

    But I can't see how to get the versions of Tcllib and Tklib. Is this possible?

    I don't think so, as each module within tcllib is separately versioned.

    You can show the versions by either capturing the return from package
    require, or by rerunning package require at the time you want the data:

    $ rlwrap tclsh
    % package require cmdline
    1.5.2
    % set cmdline_ver [package require cmdline]
    1.5.2
    % puts "cmdline version is $cmdline_ver"
    cmdline version is 1.5.2
    %

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Summerfield@21:1/5 to Rich on Thu Jun 27 05:37:11 2024
    On Wed, 26 Jun 2024 16:31:58 -0000 (UTC), Rich wrote:

    Mark Summerfield <[email protected]> wrote:
    For a --help option or for an About box I like to show lib versions.
    This is easy for Tcl and for Tk, e.g.

    "Tcl v$::tcl_patchLevel/Tk v$::tk_version"

    But I can't see how to get the versions of Tcllib and Tklib. Is this
    possible?

    I don't think so, as each module within tcllib is separately versioned.

    You can show the versions by either capturing the return from package require, or by rerunning package require at the time you want the data:

    $ rlwrap tclsh % package require cmdline 1.5.2 % set cmdline_ver
    [package require cmdline]
    1.5.2 % puts "cmdline version is $cmdline_ver" cmdline version is
    1.5.2 %

    Ok, understood. Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Thu Jun 27 19:35:49 2024
    Am 27.06.2024 um 07:37 schrieb Mark Summerfield:
    On Wed, 26 Jun 2024 16:31:58 -0000 (UTC), Rich wrote:

    Mark Summerfield <[email protected]> wrote:
    For a --help option or for an About box I like to show lib versions.
    This is easy for Tcl and for Tk, e.g.

    "Tcl v$::tcl_patchLevel/Tk v$::tk_version"

    But I can't see how to get the versions of Tcllib and Tklib. Is this
    possible?

    I don't think so, as each module within tcllib is separately versioned.

    You can show the versions by either capturing the return from package
    require, or by rerunning package require at the time you want the data:

    $ rlwrap tclsh % package require cmdline 1.5.2 % set cmdline_ver
    [package require cmdline]
    1.5.2 % puts "cmdline version is $cmdline_ver" cmdline version is
    1.5.2 %

    Ok, understood. Thanks.

    No, there is something. I asked this question and Andreas added something. https://core.tcl-lang.org/tcllib/info/13fc0520a654f9e9
    No, it is not included. But we recently have code to also include the
    fossil checkout id.
    Here is the code by Alex: https://fossil.sowaswie.de/ooxml/info/424958a4c5506180
    I will add this to the tcllib ticket...

    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)