linux - 关闭 getopt_long (optarg.h) 中的缩写?

标签 linux unix getopt getopt-long

是否可以在 getopt_long() 中关闭缩写?从手册页:

Long option names may be abbreviated if the abbreviation is unique or is an exact match for >some defined option.

我想这样做是因为我收到的一段代码规范要求标志的全长精确匹配,而且标志有很多。

最佳答案

代码猿,

似乎没有办法禁用缩写功能。您并不是唯一希望使用此功能的人。请参阅:http://sourceware.org/bugzilla/show_bug.cgi?id=6863

不幸的是,似乎 glibc 开发人员不想要该选项,因为上面链接的错误报告已通过“WONTFIX”解决。你可能在这里不走运:-\

关于linux - 关闭 getopt_long (optarg.h) 中的缩写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5182041/

相关文章:

linux - 使用 iptables 和 nfqueue 进行数据包转发

bash - 在 shell 脚本中验证日期格式

linux - 输入 dirs 命令后,我会进入哪个目录?

php - 在使用 PHP 的 getopt() 之后,我如何知道保留了哪些参数?

c - 对必需的参数使用 getopt

c++ - gengetopt : How to parse a string without an option (like a file name)

linux - 在 linux 中替换文件的字符串

c++ - 比较文本文件中的字符串

c# - 无法在 Linux 上使用 Visual Studio Code 调试 C# 测试

linux - 使用 Rsync 包含和排除选项按模式包含目录和文件