Make TkRemind support --version

This commit is contained in:
Dianne Skoll
2026-02-05 22:29:53 -05:00
parent 7841077fc6
commit 01d3081f19
2 changed files with 12 additions and 6 deletions

View File

@@ -18,10 +18,12 @@ binary. If you are using Tcl/Tk 8.5, you may also need either the Img
or the tkpng extension to handle PNG images.
.SH COMMAND-LINE OPTIONS
\fBTkRemind\fR itself has no command-line options. However, it passes
any command-line argument starting with \fB\-\fR to \fBRemind\fR as an
option. In addition, \fBTkRemind\fR will respect the \fB\-m\fR and
\fB\-b1\fR options and adjust its appearance accordingly.
\fBTkRemind\fR itself has only one command-line option:
\fB\-\-version\fR, which makes it print the version of \fBTkRemind\fR
and exit. Any other command-line argument starting with \fB\-\fR to
\fBRemind\fR as an option. In addition, \fBTkRemind\fR will respect
the \fB\-m\fR and \fB\-b1\fR options and adjust its appearance
accordingly.
.PP
\fIRead_file\fR is the file from which \fBTkRemind\fR reads reminders.
It is in standard \fBRemind\fR format. \fIWrite_file\fR is the file

View File

@@ -442,6 +442,10 @@ proc Initialize {} {
set PSCmd "$Remind -itkremind=1 -itkprint=1 -pp%WEEKS% -l %EXTRA%"
set i 0
while {$i < $argc} {
if {"[lindex $argv $i]" == "--version"} {
puts "tkremind version @VERSION@"
exit 0
}
if {[regexp -- {-[bgxim].*} [lindex $argv $i]]} {
append CommandLine " [lindex $argv $i]"
append PSCmd " [lindex $argv $i]"
@@ -3602,11 +3606,11 @@ proc main {} {
font create BoldFont {*}[font actual TkDefaultFont] -weight bold
global AppendFile HighestTagSoFar DayNames
catch { SetFonts }
Initialize
catch {
puts "\nTkRemind Copyright (C) 1996-2026 Dianne Skoll"
}
catch { SetFonts }
Initialize
# If no $ConfigFile file, create an empty one
if {![file exists $ConfigFile]} {