|
Detailed Instructions |
Top Previous Next |
|
There are three steps to using the command-line interface for Fast Formatter:
Step 1 - Create the config.xml file
Fast Formatter reads a configuration file to determine what and how to format. You can use a different name than config.xml if you prefer. Here is an example of config.xml:
<?xml version="1.0" encoding="utf-8" ?> <FFCommandLineConfig> <SolutionFile>D:\test\test.sln</SolutionFile> <FormatterOptions> <FormatAll>false</FormatAll> <Projects> <Project> <Name>test1</Name> </Project> <Project> <Name>test2</Name> </Project> <Project> <Name>test3</Name> </Project> </Projects> <InsertHeader>true</InsertHeader> <Header> <![CDATA[ <copyright file="[FileName]" company="EleganceTech"> Copyright (c) 2006-2007 EleganceTech, Inc. All rights reserved. </copyright> ]]> </Header> <UseRegularExpression>false</UseRegularExpression> <RegularExpression> <![CDATA[^//.*\<copyright.+\>.*\n.*\n.*\</copyright\>]]> </RegularExpression> </FormatterOptions> </FFCommandLineConfig>
The file correlates closely to the options that you select with the graphical interface for Fast Formatter. The <FormatAll> tag allows you to format all projects in a solution without specifying any specific project names. It is set to false in the example because we have specified specific projects to format.
Step 2 - Start formatting
To launch, open a command window and move to the directory that contains the configuration file. Assuming that the configuration file is named config.xml, you would type the following and press the enter key:
devenv /command "FastFormatter.Connect.FastFormatter config.xml"
Please make certain the you are running the correct version of devenv if you have multiple versions of Visual Studio installed on your computer. Also, you could create a shortcut or batch file if you want to format repeatedly.
Step 3 - Resolve any errors
If there are any errors that occur during formatting, Fast Formatter will create a FastFormatterErrorLog.txt file in the solution folder. If there are no errors, the no file is created.
|