Tk Library Source Code

Artifact [33216ebe64]
Login

Artifact 33216ebe644811af2429b5e75bdd3f1f06badfb4:

Attachment "arg" to ticket [3189786fff] added by guardus 2011-02-23 11:51:15.
#! /usr/bin/env tclsh

package require cmdline

set options {
    {myarg      "myarg"}
    {my2secret  "my2secret"}
    {h          "Print help"}
}

if {[catch {array set arg [::cmdline::getoptions argv $options]}]} {
    puts stderr "Error: Unknown option: [lindex $argv 0]"
    puts -nonewline [::cmdline::usage $options]
    exit 1
}

puts "options list is:\n$options"
puts "Processed arguments:"
parray arg

if {$arg(h)} {
    puts {}
    puts -nonewline [::cmdline::usage $options]
    exit 0
}