Michael Walsh | 24f9183 | 2018-02-15 17:19:54 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | #\ |
| 3 | exec wish "$0" -- ${1+"$@"} |
| 4 | |
| 5 | source [exec bash -c "which source.tcl"] |
| 6 | my_source [list print.tcl opt.tcl] |
| 7 | |
| 8 | longoptions test_mode:=0 quiet:=0 |
| 9 | pos_parms |
| 10 | |
| 11 | |
| 12 | # Create help dictionary for call to gen_print_help. |
| 13 | set help_dict [dict create\ |
| 14 | ${program_name} [list "${program_name} will..."]\ |
| 15 | ] |
| 16 | |
| 17 | |
| 18 | proc help {} { |
| 19 | |
| 20 | gen_print_help |
| 21 | |
| 22 | } |
| 23 | |
| 24 | |
| 25 | proc exit_proc { {ret_code 0} } { |
| 26 | |
| 27 | # Execute whenever the program ends normally or with the signals that we |
| 28 | # catch (i.e. TERM, INT). |
| 29 | |
| 30 | dprint_executing |
| 31 | dprint_var ret_code |
| 32 | |
| 33 | # Your code here. |
| 34 | |
| 35 | qprint_pgm_footer |
| 36 | |
| 37 | exit $ret_code |
| 38 | |
| 39 | } |
| 40 | |
| 41 | |
| 42 | proc validate_parms {} { |
| 43 | |
| 44 | trap { exit_proc } [list SIGTERM SIGINT] |
| 45 | |
| 46 | # Your code here. |
| 47 | |
| 48 | } |
| 49 | |
| 50 | |
| 51 | # Main |
| 52 | |
| 53 | gen_get_options $argv |
| 54 | |
| 55 | validate_parms |
| 56 | |
| 57 | qprint_pgm_header |
| 58 | |
| 59 | exit_proc |