proc assure-exists {opt} {
global Stash
- if {! [file exists $Stash/$opt]} {
+ if {![file exists $Stash/$opt]} {
puts stderr "not found"
exit 1
}
set idx [lindex [lsearch -all [file split $pth] "*"] end-$offset]
if {$idx != ""} {
set pth [file join {*}[lrange [file split $opt] 0 $idx]]
- if {! [file exists $Stash/$pth]} {
+ if {![file exists $Stash/$pth]} {
puts stderr "$pth does not exist"
exit 1
}
set prefix [lindex $argv 2]
}
foreach opt [walk $Schema directory] {
- if {! [file exists $opt/title]} {continue}
+ if {![file exists $opt/title]} {continue}
set name [string range $opt [expr {[string length $Schema] + 1}] end]
if {$prefix != ""} {
if {[string range $name 0 [string length $prefix]-1] != $prefix} {
get {
if {[file tail $opt] == "*"} {
set opt [file dirname $opt]
- if {! [file exists $Stash/$opt]} {
+ if {![file exists $Stash/$opt]} {
exit
}
foreach dir [readents $Stash/$opt directory] {
if {$prefixlen == ""} {
set prefixlen $deflen
}
-if {! [string is integer -strict $prefixlen]} {
+if {![string is integer -strict $prefixlen]} {
puts "invalid integer"
exit 1
}
#!/usr/bin/env jimsh
set n [read -nonewline stdin]
-if {! [regexp {^[a-z0-9]{1,16}$} $n]} {
+if {![regexp {^[a-z0-9]{1,16}$} $n]} {
puts {does not match ^[a-z0-9]{1,16}$}
exit 1
}
if {$i == ""} {
set i 1500
}
-if {! [string is integer -strict $i]} {
+if {![string is integer -strict $i]} {
puts "invalid integer"
exit 1
}
if {$n == ""} {
set n no
}
-if {! [string is boolean $n]} {
+if {![string is boolean $n]} {
puts {is not boolean}
exit 1
}
#!/usr/bin/env jimsh
set n [read -nonewline stdin]
-if {! [regexp {^[.A-Za-z0-9_-]{1,32}$} $n]} {
+if {![regexp {^[.A-Za-z0-9_-]{1,32}$} $n]} {
puts {does not match ^[.A-Za-z0-9_-]{1,32}$}
exit 1
}
#!/usr/bin/env jimsh
set n [read -nonewline stdin]
-if {! [regexp {^ssh-ed25519 [.A-Za-z0-9/+]{68,68}} $n]} {
+if {![regexp {^ssh-ed25519 [.A-Za-z0-9/+]{68,68}} $n]} {
puts {bad ssh-ed25519 key}
exit 1
}
if {$n == ""} {
set n no
}
-if {! [string is boolean $n]} {
+if {![string is boolean $n]} {
puts {is not boolean}
exit 1
}
if {$n == ""} {
set n 22
}
-if {! [string is integer -strict $n]} {
+if {![string is integer -strict $n]} {
puts "invalid integer"
exit 1
}
#!/usr/bin/env jimsh
set n [read -nonewline stdin]
-if {! [regexp {^ssh-ed25519 [.A-Za-z0-9/+]{68,68}} $n]} {
+if {![regexp {^ssh-ed25519 [.A-Za-z0-9/+]{68,68}} $n]} {
puts {bad ssh-ed25519 key}
exit 1
}
if {$n == ""} {
set n unknown
}
-if {! [regexp {^[a-z0-9]{1,32}$} $n]} {
+if {![regexp {^[a-z0-9]{1,32}$} $n]} {
puts {does not match ^[a-z0-9]{1,32}$}
exit 1
}
if {$passwd == ""} {
set passwd admin
}
-if {! [regexp {^[0-9a-z-]{1,64}$} $passwd]} {
+if {![regexp {^[0-9a-z-]{1,64}$} $passwd]} {
puts {does not match ^[0-9a-z-]{1,64}$}
exit 1
}