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