首页> 外文期刊>C - C++ Users Journal >Command-Line Argument Processing & the Mgetopt Library
【24h】

Command-Line Argument Processing & the Mgetopt Library

机译:命令行参数处理和Mgetopt库

获取原文
获取原文并翻译 | 示例
           

摘要

Command-line options represent the 'face" of the program, and tools for options parsing should be convenient and easy to use. For me it was always a tedious job to write the awkward getopt loops, especially in shell scripts. Frankly, I never understood why the getopt function is not designed in the manner of getenv. While libraries such as getopt, getopt_long, popt, and argp are powerful and rich, they don't provide utilities for parsing command options for the shell scripts. With this in mind, I wrote my own getopt library, which I call "mgetopt." I was trying to implement a solution that is equally easy to use in C and shell programs. Mgetopt supports short (see Listing 1), and GNU-style long and longshort options.
机译:命令行选项代表程序的“面孔”,用于选项解析的工具应该方便易用。对我来说,编写笨拙的getopt循环总是一件乏味的工作,尤其是在Shell脚本中。了解了为什么不按getenv的方式设计getopt函数尽管getopt,getopt_long,popt和argp之类的库功能强大且功能丰富,但它们不提供用于解析Shell脚本命令选项的实用程序。 ,我编写了自己的getopt库,称为“ mgetopt”。我试图实现一种在C和Shell程序中同样易于使用的解决方案Mgetopt支持short(请参见清单1)以及GNU风格的long和longshort。选项。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号