X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl-applet.git;a=blobdiff_plain;f=args.tcl;h=248548bcaad267bbb9ff286856bd7ff3638955f2;hp=fdcd59670050bdd87cbf9e530b2c381eb3ff41b3;hb=26a08255c2b85fb059d91c408c01851e87e7fa68;hpb=80b7c5d7160f63b9f16fd62534352b15e4c9ec6f diff --git a/args.tcl b/args.tcl index fdcd596..248548b 100644 --- a/args.tcl +++ b/args.tcl @@ -6,9 +6,9 @@ proc badusage {msg} { exit 12 } -proc badoption {msg} { +proc badoption {} { variable lastarg - badusage "unknown option $msg" + badusage "unknown option $lastarg" } proc next {} { @@ -28,19 +28,14 @@ proc next_num {} { } } -set w 50 -set h 50 -set orientation horizontal -set bc darkblue -set bw 1 - -proc generalarg {} { - switch -exact $arg { - -width { set w [next_num] } - -height { set h [next_num] } - -horizontal - -vertical { set orientation $arg } - -borderColour - -borderColor { set bc [next] } - -borderWidth { set bw [next_num] } +proc generalarg {arg} { + switch -exact -- $arg { + -width { set applet::w [next_num] } + -height { set applet::h [next_num] } + -horizontal - -vertical { set applet::deforient $arg } + -borderColour - -borderColor { set applet::border_colour [next] } + -borderWidth { set applet::border_width [next_num] } + -debug { applet::setup-debug puts } default { return 0 } } return 1