20 if {[
catch {
package require cmdline} ERROR]} {
21 puts "$ERROR\n If you are running this script on tclsh, you can fix this by installing 'tcllib'"
26 {version "If set, the version is returned rather than the git sha."}
27 {ext_path.arg "" "Path to external libraries"}
30 set usage "Returns the git SHA of the last commit in which the specified project was modified.\nUsage: $argv0 \[-version\] <project name>"
31 set tcl_path [
file dirname [
info script]]
32 set repo_path [
file normalize $tcl_path/../../..]
33 source $tcl_path/../hog.tcl
36 if {[
catch {
array set options [
cmdline::getoptions ::argv $parameters $usage]}] || [
llength $argv] < 1} {
40 set project [
lindex $argv 0]
41 if {$options(version) == 1} {
46 if {$options(ext_path) == ""} {
49 set ext_path $options(ext_path)
52 set proj_dir $repo_path/Top/$project
54 if {[
file exists $proj_dir]} {
62 Msg Error "Project $project does not exist: $proj_dir not found."