Sujet : Re: is it possible to programmatically access Tcllib and Tklib versions?
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tclDate : 26. Jun 2024, 17:31:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v5hfpu$279i8$2@dont-email.me>
References : 1
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
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
%