general procedures to deals with procedure argument passing, error handling, colors (using VT100 terminal library for TCL).

Source packages: https://github.com/octavsly/octopus

Wiki: https://github.com/octavsly/octopus/wiki

For example of usage see info_procedures.tcl script.

Example of usages:

#!/bin/sh
# the next line restarts using -*-Tcl-*-sh \
exec stclc -- "$0" ${1+"$@"}

if { [info exists env(OCTOPUS_INSTALL_PATH) ] } {
        lappend auto_path $env(OCTOPUS_INSTALL_PATH)
} else {
        puts "ERROR: Please set environmental variable OCTOPUS_INSTALL_PATH to point to the location of octopus.tcl file"
        exit 1
}

package require octopus 0.1

...

################################################################################
# BEGIN command line options/arguments parsing

::octopus::add_option "--type"                                                      --valid-values "diehard utel poptag"
::octopus::add_option "--listfile"                
::octopus::add_option "--temposync"               --default "false" 
::octopus::add_option "--corrupt-files"           --default "false" 
::octopus::add_option "--dump-expanded-file-list" --default "false" --type "boolean"
::octopus::add_option "--project-dir"             --default "false" 
::octopus::add_option "--no-email"                --default "false" --type "boolean"

::octopus::extract_check_options_data

# END command line options/arguments parsing
################################################################################

puts $type
puts $listfile
puts $temposync
puts $corrupt-files
puts $dump-expanded-file-list
puts $project-dir
puts ${no-email}