﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-jokes000-文章分类-Tutorials</title><link>http://www.cppblog.com/jokes000/category/17958.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 21 Oct 2011 15:27:43 GMT</lastBuildDate><pubDate>Fri, 21 Oct 2011 15:27:43 GMT</pubDate><ttl>60</ttl><item><title>astyle使用基础教程</title><link>http://www.cppblog.com/jokes000/articles/158838.html</link><dc:creator>Voices.</dc:creator><author>Voices.</author><pubDate>Fri, 21 Oct 2011 09:59:00 GMT</pubDate><guid>http://www.cppblog.com/jokes000/articles/158838.html</guid><wfw:comment>http://www.cppblog.com/jokes000/comments/158838.html</wfw:comment><comments>http://www.cppblog.com/jokes000/articles/158838.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/jokes000/comments/commentRss/158838.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/jokes000/services/trackbacks/158838.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #363636; font-family: verdana, sans-serif; background-color: #ffffff; "><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">转自：</p></span><span class="Apple-style-span" style="color: #363636; font-family: verdana, sans-serif; line-height: 25px; background-color: #ffffff; "><a href="http://babybandf.blog.163.com/blog/static/61993532010112205811797/">http://babybandf.blog.163.com/blog/static/61993532010112205811797/</a></span><span class="Apple-style-span" style="color: #363636; font-family: verdana, sans-serif; background-color: #ffffff; "><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><br />astyle是一个我自己常用的开放源码工具。它可以方便的将程序代码格式化成自己想要的样式而不必人工修改。本来嘛，作为高等生物应该优先去做一些智慧的事情，而不是把时间消耗在机器可以完美完成的事情上。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">想要立刻开始？请先去主页<a target="_blank" rel="nofollow" href="http://sourceforge.net/projects/astyle" style="line-height: 25px; text-decoration: none; color: #336699; cursor: pointer; ">http://sourceforge.net/projects/astyle</a>下载最新版本。可以选择二进制版本，也可以下载源码自行编译。总之得到可执行文件后请将astyle放在Path(C:\Program Files\Microsoft Visual Studio 8\Common7\IDE)中，这样会方便很多。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">astyle是一个命令行工具，命令语法很简单：<br style="line-height: 25px; " /><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; astyle [options] &lt; original &gt; Beautified<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; astyle [options] Foo.cpp Bar.cpp&nbsp; [...]</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">例如：</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; astyle --style=ansi foo.cpp</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">上面的命令将美化foo.cpp文件，更改其风格为ANSI，并将原始文件备份到foo.cpp.orgin。所以，你可以安全的使用该软件而不必担心会将代码改得无法回头。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">具体的来说，astyle包含了以下几种预定义风格，只需在参数中简单指定即可使用：</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　--style=ansi：ANSI 风格格式和缩进</p><table bordercolor="#ffcc66" width="90%" align="center" bgcolor="#dadacf" border="1" style="line-height: 25px; "><tbody style="line-height: 25px; "><tr style="line-height: 25px; "><td style="line-height: 25px; ">namespace foospace<br style="line-height: 25px; " />{<br style="line-height: 25px; " />　int Foo()<br style="line-height: 25px; " />　{<br style="line-height: 25px; " />　　if (isBar)<br style="line-height: 25px; " />　　{<br style="line-height: 25px; " />　　　bar();<br style="line-height: 25px; " />　　　return 1;<br style="line-height: 25px; " />　　}<br style="line-height: 25px; " />　　else<br style="line-height: 25px; " />　　　return 0;<br style="line-height: 25px; " />　}<br style="line-height: 25px; " />}</td></tr></tbody></table><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><br style="line-height: 25px; " />　　--style=kr ：Kernighan&amp;Ritchie 风格格式和缩进</p><table bordercolor="#ffcc66" width="90%" align="center" bgcolor="#dadacf" border="1" style="line-height: 25px; "><tbody style="line-height: 25px; "><tr style="line-height: 25px; "><td style="line-height: 25px; ">namespace foospace {<br style="line-height: 25px; " />　int Foo() {<br style="line-height: 25px; " />　　if (isBar) {<br style="line-height: 25px; " />　　　bar();<br style="line-height: 25px; " />　　　return 1;<br style="line-height: 25px; " />　　} else<br style="line-height: 25px; " />　　　return 0;<br style="line-height: 25px; " />　}<br style="line-height: 25px; " />}</td></tr></tbody></table><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><br style="line-height: 25px; " />　　--style=linux ：Linux 风格格式和缩进</p><table bordercolor="#ffcc66" width="90%" align="center" bgcolor="#dadacf" border="1" style="line-height: 25px; "><tbody style="line-height: 25px; "><tr style="line-height: 25px; "><td style="line-height: 25px; ">namespace foospace<br style="line-height: 25px; " />{<br style="line-height: 25px; " />　int Foo()<br style="line-height: 25px; " />　{<br style="line-height: 25px; " />　　if (isBar) {<br style="line-height: 25px; " />　　　bar();<br style="line-height: 25px; " />　　　return 1;<br style="line-height: 25px; " />　　} else&nbsp;<br style="line-height: 25px; " />　　　return 0;<br style="line-height: 25px; " />　}<br style="line-height: 25px; " />}</td></tr></tbody></table><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><br style="line-height: 25px; " />　　--style=gnu ：GNU 风格格式和缩进</p><table bordercolor="#ffcc66" width="90%" align="center" bgcolor="#dadacf" border="1" style="line-height: 25px; "><tbody style="line-height: 25px; "><tr style="line-height: 25px; "><td style="line-height: 25px; ">namespace foospace<br style="line-height: 25px; " />{<br style="line-height: 25px; " />　int Foo()<br style="line-height: 25px; " />　{<br style="line-height: 25px; " />　　if (isBar)<br style="line-height: 25px; " />　　{<br style="line-height: 25px; " />　　　bar();<br style="line-height: 25px; " />　　　return 1;<br style="line-height: 25px; " />　　}<br style="line-height: 25px; " />　　else<br style="line-height: 25px; " />　　　return 0;<br style="line-height: 25px; " />　}<br style="line-height: 25px; " />}</td></tr></tbody></table><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><br style="line-height: 25px; " />　　--style=java ：Java 风格格式和缩进</p><table bordercolor="#ffcc66" width="90%" align="center" bgcolor="#dadacf" border="1" style="line-height: 25px; "><tbody style="line-height: 25px; "><tr style="line-height: 25px; "><td style="line-height: 25px; ">class foospace {<br style="line-height: 25px; " />　int Foo() {<br style="line-height: 25px; " />　　if (isBar) {<br style="line-height: 25px; " />　　　bar();<br style="line-height: 25px; " />　　　return 1;<br style="line-height: 25px; " />　　} else<br style="line-height: 25px; " />　　　return 0;<br style="line-height: 25px; " />　}<br style="line-height: 25px; " />}</td></tr></tbody></table><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">从这里开始介绍astyle的高级应用！这里要介绍的是两种应用情形，一是在Visual Studio中整合，二是批量处理。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">先看如何在Visual Studio中整合。看图说话！</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">第一步：点击&#8220;工具&#8221;菜单</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">第二步：点击&#8220;外部工具&#8221;</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">第三步：配置并保存</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">在对话框中点击&#8220;添加&#8221;，如图填入各项。其中参数填写&nbsp;<font face="Courier New" style="line-height: 25px; ">--style=ansi $(ItemFileName)$(ItemExt)</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">可以勾选&#8220;使用输出窗口&#8221;，这样将不会显示黑色的命令窗口。相关信息都会显示在Visual Studio中。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">经过上面设置之后，只需点击该菜单项就可以将当前文档格式化成ansi风格。如果你想要其它风格，可以自行设置参数。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">值得注意的是在低版本的Visual Studio中，默认设置运行外部程序不会保存当前文档。这样的话如果在未保存的情况下运行该命令，未保存部分将会丢失。这个可以通过设置一个选项来解决。Visual Studio 6.0中：Options -&gt; Editor -&gt; Save Options -&gt; Save before running tools 将该项勾选即可。我已经验证，在Visual Studio 2005中不用担心这类问题，可以放心使用。但是作为一个好习惯，我仍然建议你随时保存你的工作，尤其是做这种大幅度改动之前，甚至应该对源代码进行Check in操作。不知道Check in是什么？没关系，过几天我还会写一篇关于代码控制的文章，应该可以解决你的疑惑。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">1.常用功能<br style="line-height: 25px; " />(1) 单个文件--缺省美化<br style="line-height: 25px; " />astyle --style=<font face="Courier New" style="line-height: 25px; ">ansi</font>&nbsp;Form1.cs<br style="line-height: 25px; " />处理前的代码：<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; private void Form1_Load(object sender, EventArgs e)<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; {<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int s;<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i=0;i&lt;10;i++){<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int j=0;j&lt;10; j++){<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s = s+j+i;}<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; }<br style="line-height: 25px; " />处理后：<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; private void Form1_Load(object sender, EventArgs e)<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; {<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int s;<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i=0;i&lt;10;i++)<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int j=0;j&lt;10; j++)<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s = s+j+i;<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; }</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">(2) 单个文件--更改缩进2个空格<br style="line-height: 25px; " />astyle --style=<font face="Courier New" style="line-height: 25px; ">ansi</font>&nbsp;--indent=spaces=2 Form1.cs<br style="line-height: 25px; " />缺省缩进一个TAB，也可以显式说明使用Tab，如下：<br style="line-height: 25px; " />astyle --style=<font face="Courier New" style="line-height: 25px; ">ansi</font>&nbsp;--indent=tab Form1.cs</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">(3) 处理多个文件--有限个<br style="line-height: 25px; " />astyle --style=<font face="Courier New" style="line-height: 25px; ">ansi</font>&nbsp;Form1.cs Form2.cs</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">(4) 批量处理多个文件--无限个<br style="line-height: 25px; " />for /R .\ %f in (*.cs) do astyle --style=ansi "%f"<br style="line-height: 25px; " />说明：/R表明遍历一个目录树，后面紧跟的路径是根，缺省为当前目录。<br style="line-height: 25px; " />本例中，根为.\表示当前目录，命令等价于：<br style="line-height: 25px; " />for /R %f in (*.cs) do astyle --style=ansi "%f"<br style="line-height: 25px; " />作用是从（目录树根）当前目录开始，查找所有java文件，包含子目录中的文件；然后交给astyle处理。<br style="line-height: 25px; " />当然，目录树根也可以使用绝对路径，下面的命令查找C盘所有的java文件并处理。<br style="line-height: 25px; " />for /R c:\ %f in (*.cs) do astyle --style=ansi "%f"</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">2.&nbsp;其他比较有用的开关：<br style="line-height: 25px; " />(1) -f<br style="line-height: 25px; " />在两行不相关的代码之间插入空行，如import和public class之间、public class和成员之间等；<br style="line-height: 25px; " />(2) -p<br style="line-height: 25px; " />在操作符两边插入空格，如=、+、-等。<br style="line-height: 25px; " />如：int a=10*60;<br style="line-height: 25px; " />处理后变成int a = 10 * 60;<br style="line-height: 25px; " />(3) -P<br style="line-height: 25px; " />在括号两边插入空格。另，-d只在括号外面插入空格，-D只在里面插入。<br style="line-height: 25px; " />如：MessageBox.Show ("aaa");<br style="line-height: 25px; " />处理后变成MessageBox.Show ( "aaa" );<br style="line-height: 25px; " />(4) -U<br style="line-height: 25px; " />移除括号两边不必要的空格。<br style="line-height: 25px; " />如：MessageBox.Show ( "aaa" );<br style="line-height: 25px; " />处理后变成MessageBox.Show ("aaa");<br style="line-height: 25px; " />(5) -V<br style="line-height: 25px; " />将Tab替换为空格。&nbsp;</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">下面再介绍第二项独门绝技：批量格式化！</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">有时候你会有很多文件需要格式化成统一风格，难道一个个点击菜单？不！那样太累了。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">在Windows中，我们可以用命令行来解决问题。这里用到一个超级命令 for</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">我来写个范例，大家就知道该怎么处理了。</p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong style="line-height: 25px; ">for /R %f in (*.cpp;*.c;*.h) do astyle --style=ansi "%f"</strong></font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">该命令在当前目录中寻找文件名匹配模式&nbsp;<font face="Courier New" style="line-height: 25px; ">*.cpp;*.c;*.h 的所有文件(不同模式可用英文逗号隔开)，并且对每个文件%f执行操作：</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&nbsp;<font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong style="line-height: 25px; ">astyle --style=ansi "%f"</strong></font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">好了，本教程可以结束了。希望对你有所帮助。</p><hr style="line-height: 25px; " /><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; "></font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">下面是标准的程序文档，如果你想了解更多用法，可以一读；如果你只是像我一样日常使用该工具，就可以不看了。</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Artistic Style 1.15.3&nbsp;&nbsp; (</font><a rel="nofollow" href="http://www.bigfoot.com/~davidsont/astyle" style="line-height: 25px; text-decoration: none; color: #336699; "><font face="Courier New" style="line-height: 25px; ">http://www.bigfoot.com/~davidsont/astyle</font></a><font face="Courier New" style="line-height: 25px; ">)<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (created by Tal Davidson,&nbsp;</font><a rel="nofollow" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#100;&#97;&#118;&#105;&#100;&#115;&#111;&#110;&#116;&#64;&#98;&#105;&#103;&#102;&#111;&#111;&#116;&#46;&#99;&#111;&#109;" style="line-height: 25px; text-decoration: none; color: #336699; "><font face="Courier New" style="line-height: 25px; ">davidsont@bigfoot.com</font></a><font face="Courier New" style="line-height: 25px; ">)</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Modified edition by Qiongzhu Wan</font><font face="Courier New" style="line-height: 25px; ">, 2004.09</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Usage&nbsp; :&nbsp; astyle [options] &lt; original &gt; Beautified<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; astyle [options] Foo.cpp Bar.cpp&nbsp; [...]</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">When indenting a specific file, the resulting indented file RETAINS the<br style="line-height: 25px; " />original file-name. The original pre-indented file is renamed, with a<br style="line-height: 25px; " />suffix of ".orig" added to the original filename.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">By default, astyle is set up to indent C/C++/C# files, with 4 spaces per<br style="line-height: 25px; " />indent, a maximal indentation of 40 spaces inside continuous statements,<br style="line-height: 25px; " />and NO formatting.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Option's Format:<br style="line-height: 25px; " />----------------<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Long options (starting with '--') must be written one at a time.<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Short options (starting with '-') may be appended together.<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Thus, -bps4 is the same as -b -p -s4.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Predefined Styling options:<br style="line-height: 25px; " />--------------------<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; --style=ansi<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; ANSI style formatting/indenting.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --style=kr<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Kernighan&amp;Ritchie style formatting/indenting.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --style=gnu<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; GNU style formatting/indenting.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --style=java<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Java mode, with standard java style formatting/indenting.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --style=linux<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Linux mode (i.e. 8 spaces per indent, break definition-block<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; brackets but attach command-block brackets.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Indentation options:<br style="line-height: 25px; " />--------------------<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; -c&nbsp;&nbsp; or&nbsp;&nbsp; --mode=c<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent a C, C++ or C# source file (default)</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -j&nbsp;&nbsp; or&nbsp;&nbsp; --mode=java<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent a Java(TM) source file</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -s&nbsp;&nbsp; or&nbsp;&nbsp; -s#&nbsp;&nbsp; or&nbsp;&nbsp; --indent=spaces=#<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent using # spaces per indent. Not specifying #<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; will result in a default of 4 spacec per indent.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -t&nbsp;&nbsp; or&nbsp;&nbsp; -t#&nbsp;&nbsp; or&nbsp;&nbsp; --indent=tab=#<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent using tab characters, assuming that each<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; tab is # spaces long. Not specifying # will result<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; in a default assumption of 4 spaces per tab.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -T#&nbsp;&nbsp; or&nbsp;&nbsp; --force-indent=tab=#&nbsp;&nbsp;&nbsp; Indent using tab characters, assuming tha<br style="line-height: 25px; " />t each<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; tab is # spaces long. Force tabs to be used in areas<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Astyle would prefer to use spaces.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -C&nbsp;&nbsp; or&nbsp;&nbsp; --indent-classes<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent 'class' blocks, so that the inner 'public:',<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; 'protected:' and 'private: headers are indented in<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; relation to the class block.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -S&nbsp;&nbsp; or&nbsp;&nbsp; --indent-switches<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent 'switch' blocks, so that the inner 'case XXX:'<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; headers are indented in relation to the switch block.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -K&nbsp;&nbsp; or&nbsp;&nbsp; --indent-cases<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent 'case XXX:' lines, so that they are flush with<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; their bodies..</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -N&nbsp;&nbsp; or&nbsp;&nbsp; --indent-namespaces<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent the contents of namespace blocks.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -B&nbsp;&nbsp; or&nbsp;&nbsp; --indent-brackets<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Add extra indentation to '{' and '}' block brackets.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -G&nbsp;&nbsp; or&nbsp;&nbsp; --indent-blocks<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Add extra indentation entire blocks (including brackets).</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -L&nbsp;&nbsp; or&nbsp;&nbsp; --indent-labels<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent labels so that they appear one indent less than<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; the current indentation level, rather than being<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; flushed completely to the left (which is the default).</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -m#&nbsp; or&nbsp; --min-conditional-indent=#<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent a minimal # spaces in a continuous conditional<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; belonging to a conditional header.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -M#&nbsp; or&nbsp; --max-instatement-indent=#<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent a maximal # spaces in a continuous statement,<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; relatively to the previous line.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -E&nbsp; or&nbsp; --fill-empty-lines<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Fill empty lines with the white space of their<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; previous lines.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --indent-preprocessor<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Indent multi-line #define statements</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Formatting options:<br style="line-height: 25px; " />-------------------<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; -b&nbsp; or&nbsp; --brackets=break<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Break brackets from pre-block code (i.e. ANSI C/C++ style).</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -a&nbsp; or&nbsp; --brackets=attach<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Attach brackets to pre-block code (i.e. Java/K&amp;R style).</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -l&nbsp; or&nbsp; --brackets=linux<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Break definition-block brackets and attach command-block<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; brackets.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --brackets=break-closing-headers<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Break brackets before closing headers (e.g. 'else', 'catch', ..).<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Should be appended to --brackets=attach or --brackets=linux.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -o&nbsp;&nbsp; or&nbsp; --one-line=keep-statements<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Don't break lines containing multiple statements into<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; multiple single-statement lines.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -O&nbsp;&nbsp; or&nbsp; --one-line=keep-blocks<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Don't break blocks residing completely on one line</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -p&nbsp;&nbsp; or&nbsp; --pad=oper<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Insert space paddings around operators only.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --pad=paren<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Insert space paddings around parenthesies only.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -P&nbsp;&nbsp; or&nbsp; --pad=all<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Insert space paddings around operators AND parenthesies.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --convert-tabs<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Convert tabs to spaces.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --break-blocks<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Insert empty lines around unrelated blocks, labels, classes, ...</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --break-blocks=all<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Like --break-blocks, except also insert empty lines<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; around closing headers (e.g. 'else', 'catch', ...).</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; --break-elseifs<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Break 'else if()' statements into two different lines.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Other options:<br style="line-height: 25px; " />-------------<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; --suffix=####<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Append the suffix #### instead of '.orig' to original filename.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -X&nbsp;&nbsp; or&nbsp; --errors-to-standard-output<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Print errors and help information to standard-output rather than<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; to standard-error.</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -v&nbsp;&nbsp; or&nbsp;&nbsp; --version<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Print version number</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">&nbsp;&nbsp;&nbsp; -h&nbsp;&nbsp; or&nbsp;&nbsp; -?&nbsp;&nbsp; or&nbsp;&nbsp; --help<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Print this help message</font></p><p style="line-height: 25px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><font face="Courier New" style="line-height: 25px; ">Default options file:<br style="line-height: 25px; " />---------------------<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Artistic Style looks for a default options file in the<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; following order:<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; 1. The contents of the ARTISTIC_STYLE_OPTIONS environment<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; variable if it exists.<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; 2. The file called .astylerc in the directory pointed to by the<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HOME environment variable ( i.e. $HOME/.astylerc ).<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; 3. The file called .astylerc in the directory pointed to by the<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HOMEPATH environment variable ( i.e. %HOMEPATH%\.astylerc ).<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; If a default options file is found, the options in this file<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; will be parsed BEFORE the command-line options.<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; Options within the default option file may be written without<br style="line-height: 25px; " />&nbsp;&nbsp;&nbsp; the preliminary '-' or '--'.</font></p></span><img src ="http://www.cppblog.com/jokes000/aggbug/158838.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/jokes000/" target="_blank">Voices.</a> 2011-10-21 17:59 <a href="http://www.cppblog.com/jokes000/articles/158838.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>