mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06: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 == ""} {
|
||||
|
||||
# help general
|
||||
foreach h [lsort [array names Draw_Groups]] {
|
||||
puts ""
|
||||
puts ""
|
||||
puts $h
|
||||
set i 0
|
||||
foreach f [lsort $Draw_Groups($h)] {
|
||||
if {$i == 0} {
|
||||
puts ""
|
||||
puts -nonewline " "
|
||||
}
|
||||
puts -nonewline $f
|
||||
for {set j [string length $f]} {$j < 15} {incr j} {
|
||||
puts -nonewline " "
|
||||
}
|
||||
incr i
|
||||
if {$i == 4} {set i 0}
|
||||
}
|
||||
puts ""
|
||||
}
|
||||
# help general
|
||||
foreach h [lsort [array names Draw_Groups]] {
|
||||
puts ""
|
||||
puts ""
|
||||
puts $h
|
||||
set i 0
|
||||
foreach f [lsort $Draw_Groups($h)] {
|
||||
if {$i == 0} {
|
||||
puts ""
|
||||
puts -nonewline " "
|
||||
}
|
||||
puts -nonewline $f
|
||||
for {set j [string length $f]} {$j < 15} {incr j} {
|
||||
puts -nonewline " "
|
||||
}
|
||||
incr i
|
||||
if {$i == 4} {set i 0}
|
||||
}
|
||||
puts ""
|
||||
}
|
||||
} elseif {$helpstring == ""} {
|
||||
|
||||
# help fonction
|
||||
append command "*"
|
||||
foreach f [lsort [array names Draw_Helps]] {
|
||||
if {[string match $command $f]} {
|
||||
puts -nonewline $f
|
||||
for {set j [string length $f]} {$j < 15} {incr j} {
|
||||
puts -nonewline " "
|
||||
}
|
||||
puts " : $Draw_Helps($f)"
|
||||
}
|
||||
}
|
||||
# help function
|
||||
set isfound 0
|
||||
foreach f [lsort [array names Draw_Helps]] {
|
||||
if {[string match $command $f]} {
|
||||
puts -nonewline $f
|
||||
for {set j [string length $f]} {$j < 15} {incr j} {
|
||||
puts -nonewline " "
|
||||
}
|
||||
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 {
|
||||
|
||||
# set help
|
||||
lappend Draw_Groups($group) $command
|
||||
set Draw_Helps($command) $helpstring
|
||||
# set help
|
||||
lappend Draw_Groups($group) $command
|
||||
set Draw_Helps($command) $helpstring
|
||||
}
|
||||
|
||||
flush stdout
|
||||
|
Loading…
x
Reference in New Issue
Block a user