Hello, I'm sending a new patch with more options: -forward (starts the timer forward after execute the program) -backward TIME (starts the timer backward after execute the program)
Cheers, -- Carles Pina i Estany GPG id: 0x17756391 http://pinux.info
--- /usr/bin/stopwatch 2008-07-02 13:13:46.000000000 +0200 +++ stopwatch 2008-12-06 01:40:38.815444276 +0100 @@ -392,6 +392,14 @@ " + .help.text insert end "Command line arguments" h1 + .help.text insert end " + +-forward: executes stopwatcher with the timer on +-backward TIME: executes stopwatch with the timer on, backward, with initial TIME as time (same format than stopwatch GUI) + +" + .help.text insert end "Caveats" h1 .help.text insert end { @@ -471,4 +479,15 @@ bind all <z> {.lapzero invoke} ; bind all <Control-z> {lapzr} bind all <Z> {.totalzero invoke} ; bind all <Control-Z> {totalzr} +set option_location [lsearch $argv "-forward"] +if { $option_location >= 0 } { + start +} + +set option_location [lsearch $argv "-backward"] +if { $option_location >= 0 } { + set time(total) [lindex $argv [expr {$option_location+1}]] + set time(forward) 0 + start +}