From 01d3081f19a24b8363fd2ce9b9780779c0e7631d Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Thu, 5 Feb 2026 22:29:53 -0500 Subject: [PATCH] Make TkRemind support --version --- man/tkremind.1.in | 10 ++++++---- scripts/tkremind.in | 8 ++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/man/tkremind.1.in b/man/tkremind.1.in index d309b320..bc5ccf78 100644 --- a/man/tkremind.1.in +++ b/man/tkremind.1.in @@ -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 diff --git a/scripts/tkremind.in b/scripts/tkremind.in index 34aad350..f1a57ee5 100644 --- a/scripts/tkremind.in +++ b/scripts/tkremind.in @@ -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]} {