Tcl 中的命令行解析 [英] Command line parsing in Tcl

查看:54
本文介绍了Tcl 中的命令行解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要许多短选项和长选项的脚本,我想知道解析命令行参数的最有效方法是什么.使用 for-each 和 if-else 会使代码过长且难以修改,那么是否有任何标准函数可以帮助我(例如 getopt for C)?

I have a script that will require many short and long options and was wondering what would be the most efficient way to parse the command line arguments. Using for-each and if-else would make the code too long and difficult to modify, so is there be any standard function that can help me (something like getopt for C)?

推荐答案

我们讨论了这个 四天前 并发布了一些建议.

We discussed this four days ago and a few suggestions were posted.

还有 cmdline Tcllib 中的包.

There is also the cmdline package in Tcllib.

这篇关于Tcl 中的命令行解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆