File: 03_start.diff

package info (click to toggle)
stopwatch 3.5-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 208 kB
  • sloc: tcl: 1,026; makefile: 26
file content (39 lines) | stat: -rw-r--r-- 1,237 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Description: adds options -forward and -backward to start stopwatch
             with timer on.
Author: Carles Pina i Estany <carles@pina.cat>. (Closes: #507507)
Last-Update: 2008-12-06
Index: stopwatch-3.5/stopwatch
===================================================================
--- stopwatch-3.5.orig/stopwatch
+++ stopwatch-3.5/stopwatch
@@ -392,6 +392,14 @@ Holding down the control key while press
 
 "
 
+    .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 <R> {.totalrecord  invoke} ; bi
 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
+}