홈페이지 : http://www.chevreux.org/projects_tcl.html
argp 패키지는 Tcl 프로시저(예: Tk 위젯에 전달되는 인자) 또는 Tcl 스크립트에 전달되는 커맨드라인 인자에서 선택적 인자를 간단하고 유연하게 사용하고 파싱할 수 있도록 해줍니다. argp 패키지는 필요에 따라 인자 타입과 인자 값에 대한 암시적 검사를 지원합니다.
The argp package allows simple and flexible using and parsing optional arguments in tcl procs (like arguments given to Tk widgets) or commandline arguments given to a tcl script. The argp package allows implicit checking for argument types and argument values if needed.
set auto_path [linsert $auto_path 0 ..]
package require argp 0.1
namespace eval myprog {
argp::registerArgs myparse {
{-name string tclsh {tclsh tcl wish wishx} }
{-number integer 10 { { - -20 } { 5 100 } { 200 +} } }
{-%cpu double 90 { 50.0 50.1 50.3 { 90 100 } } }
{-alive boolean 1 { 1 } }
}
}
proc myprog::myparse {args} {
# parse
argp::parseArgs opts
# and show the values (given or set by default)
foreach {k v} [array get opts] {
puts "option $k has value $v"
}
}
eval myprog::myparse $argv
'Tcl & Tk > 확장 패키지 (Extension Package)' 카테고리의 다른 글
libpgtcl 2.1.1 (0) | 2025.09.01 |
---|---|
SimpleDevLib 1.0 (0) | 2025.09.01 |
Swank 2.1.3 (0) | 2025.09.01 |
hash 0.2a1 (0) | 2025.09.01 |
tclpcap 2.0.0 (0) | 2025.09.01 |