我知道C++中的boost::program_options
,它使我几乎可以立即编写用户友好的命令行选项。以“用户友好”我的意思是,短期和长期的选择和描述的帮助命令,将类似于此:我必须找到了,这是真的尴尬在bash与内置用户友好的命令行选项
Copy standard input to each FILE, and also to standard output.
-a, --append append to the given FILEs, do not overwrite
-i, --ignore-interrupts ignore interrupt signals
--help display this help and exit
--version output version information and exit
至于我自己在getopts
只支持短期选项。这是正确的还是我错了?
您将如何实现用户友好的命令行选项?如果你知道任何链接,最佳实践或深度教程,我将非常感激。
'/ usr/bin/getopt' – 2012-08-15 22:55:54
请参阅:http://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-行选项 – pb2q 2012-08-15 23:14:22