mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0024802: "help" command shouldn't apply implicit rules in definition process of what command description it should show
-When in "help <command>" <command> was exactly found in existing draw commands, then helpstring for this <command> is displayed, else "help" fails and error message is displayed -When "*word" or "word*" or any other combination is given in args, then help command performs typical wildcard search.
This commit is contained in:
parent
e3709f1d0a
commit
2bc75a1bce
@ -39,44 +39,52 @@ proc help {{command ""} {helpstring ""} {group "Procedures"}} {
|
|||||||
|
|
||||||
if {$command == ""} {
|
if {$command == ""} {
|
||||||
|
|
||||||
# help general
|
# help general
|
||||||
foreach h [lsort [array names Draw_Groups]] {
|
foreach h [lsort [array names Draw_Groups]] {
|
||||||
puts ""
|
puts ""
|
||||||
puts ""
|
puts ""
|
||||||
puts $h
|
puts $h
|
||||||
set i 0
|
set i 0
|
||||||
foreach f [lsort $Draw_Groups($h)] {
|
foreach f [lsort $Draw_Groups($h)] {
|
||||||
if {$i == 0} {
|
if {$i == 0} {
|
||||||
puts ""
|
puts ""
|
||||||
puts -nonewline " "
|
puts -nonewline " "
|
||||||
}
|
}
|
||||||
puts -nonewline $f
|
puts -nonewline $f
|
||||||
for {set j [string length $f]} {$j < 15} {incr j} {
|
for {set j [string length $f]} {$j < 15} {incr j} {
|
||||||
puts -nonewline " "
|
puts -nonewline " "
|
||||||
}
|
}
|
||||||
incr i
|
incr i
|
||||||
if {$i == 4} {set i 0}
|
if {$i == 4} {set i 0}
|
||||||
}
|
}
|
||||||
puts ""
|
puts ""
|
||||||
}
|
}
|
||||||
} elseif {$helpstring == ""} {
|
} elseif {$helpstring == ""} {
|
||||||
|
|
||||||
# help fonction
|
# help function
|
||||||
append command "*"
|
set isfound 0
|
||||||
foreach f [lsort [array names Draw_Helps]] {
|
foreach f [lsort [array names Draw_Helps]] {
|
||||||
if {[string match $command $f]} {
|
if {[string match $command $f]} {
|
||||||
puts -nonewline $f
|
puts -nonewline $f
|
||||||
for {set j [string length $f]} {$j < 15} {incr j} {
|
for {set j [string length $f]} {$j < 15} {incr j} {
|
||||||
puts -nonewline " "
|
puts -nonewline " "
|
||||||
}
|
}
|
||||||
puts " : $Draw_Helps($f)"
|
puts " : $Draw_Helps($f)"
|
||||||
}
|
set isfound 1
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if {!$isfound} {
|
||||||
|
if {[string first * $command] != -1} {
|
||||||
|
puts "No matching commands found!"
|
||||||
|
} else {
|
||||||
|
puts "No help found for '$command'! Please try 'help $command*' to find matching commands."
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
# set help
|
# set help
|
||||||
lappend Draw_Groups($group) $command
|
lappend Draw_Groups($group) $command
|
||||||
set Draw_Helps($command) $helpstring
|
set Draw_Helps($command) $helpstring
|
||||||
}
|
}
|
||||||
|
|
||||||
flush stdout
|
flush stdout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user