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

    From Mark Summerfield@mark@qtrac.eu to comp.lang.tcl on Wed Jun 26 07:40:00 2024
    From Newsgroup: comp.lang.tcl

    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?
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Rich@rich@example.invalid to comp.lang.tcl on Wed Jun 26 16:31:58 2024
    From Newsgroup: comp.lang.tcl

    Mark Summerfield <mark@qtrac.eu> 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
    %
    --- Synchronet 3.20a-Linux NewsLink 1.114