2011年06月12日 星期日 11:15
我在多台机器上试过,都没问题。 会不会是你的getopt的版本会把独立的"-"吃掉?反正没想明白。你可以简单改一下看看。main函数里的部分非常简单的。 2011/5/26 Zhang Weiwu <zhangweiwu在realss.com>: > On 05/26/2011 11:07 AM, Yongwei Wu wrote: >> >> breaktext支持从stdin读取(使用"-"作为文件名)。 > > 前贴提问前我就试过了: > > $ echo helo | breaktext -w40 - > Usage: breaktext [OPTION]... [Output File] > $Date: 2009/04/09 09:13:44 $ > > Available options: > -LLocale of the console (system locale by default) > -lLanguage of input (asssume no language by default) > -wWidth of output text (72 by default) > -v Be verbose > > If the output file is omitted, stdout will be used. > The input file cannot be omitted, but you may use `-' for stdin. > > The `native' wide character type (wchar_t) is used in I/O routines, > and the encoding used is platform-dependent. On POSIX-compliant > systems, the environment variables LANG, LC_ALL, and LC_CTYPE > control the locale/encoding (unless overridden with the -L option), > and UTF-8 will probably be used by default on modern systems. On > Windows, the encoding is dependent on whether stdin/stdout is used > for I/O: console I/O will be automatically converted to/from > wchar_t (which is UTF-16) according to the system locale setting > (overridable with -L), but files (excepting the stdin/stdout case) > will always be in just wchar_t (UTF-16). > > -- Wu Yongwei URL: http://wyw.dcweb.cn/
Zeuux © 2024
京ICP备05028076号