Skip to content

Commit 3699080

Browse files
committed
Merge pull request #39 from ogail/master
Update the CLI docs
2 parents 1267003 + ccc691b commit 3699080

File tree

1 file changed

+14
-39
lines changed

1 file changed

+14
-39
lines changed

Documentation/cli.md

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,41 @@
11
#AutoRest Command Line Interface Documentation
22

3-
##Contents
4-
5-
* [Name](#name)
6-
* [Synopsis](#synopsis)
7-
* [Description](#description)
8-
* [Parameters](#parameters)
9-
* [Examples](#examples)
10-
11-
12-
##Name
13-
`AutoRest.exe` The **AutoRest** tool generates client libraries for accessing RESTful web services.
14-
15-
##Synopsis
3+
##Syntax
164
```bash
17-
'AutoRest.exe' -CodeGenerator <value> -Modeler <value> -Input <value> -BaseNamespace <value> [-OutputFolder <value>] [-OutputAsSingleFile <value>] [-Header <value>] [-AddCredentials <value>]
5+
AutoRest.exe -CodeGenerator <value> -Modeler <value> -Input <value> -BaseNamespace <value> [-OutputFolder <value>] [-OutputAsSingleFile <value>] [-Header <value>] [-AddCredentials <value>]
186
```
19-
##Description
20-
AutoRest is an extensible client library generator and can support multiple types of input and output. AutoRest.exe comes with the `AutoRest.json` configuration file that defines the available inputs (Modelers) and outputs (CodeGenerators). When invoking AutoRest.exe, you must specify the `-Modeler` and `-CodeGenerator` to use.
217

228
##Parameters
23-
**-OutputFolder**
24-
Output folder for generated files. Defaults to `Generated` directory.
9+
**-OutputFolder** Output folder for generated files. Defaults to Generated directory.
2510

26-
**-OutputAsSingleFile**
27-
Output file name. If specified, all the code will be written into this single file. Otherwise, AutoRest will split code by operations and write individual files into OutputFolder.
11+
**-OutputAsSingleFile** Output file name. If specified, all the code will be written into this single file. Otherwise, AutoRest will split code by operations and write individual files into OutputFolder.
2812

29-
**-CodeGenerator**
30-
Code generation language. So far we have the following languages supported (the list is growing):
13+
**-CodeGenerator** Code generation language.
3114

32-
- C#
15+
**-Modeler** Modeler for the input specification.
3316

34-
**-Modeler**
35-
The input specification type. So far we only support [Swagger 2.0](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md).
17+
**-Input** Path to the input specification file. URLs are not supported at this moment.
3618

37-
**-Input**
38-
Path to the input specification file. URLs are not supported at this moment.
19+
**-BaseNamespace** Base namespace for generated code
3920

40-
**-BaseNamespace**
41-
Base namespace for generated code. This is a required parameter but not used for all languages.
21+
**-Header** Default file header contents. Use NONE if no header is required.
4222

43-
**-Header**
44-
Default file header contents. Use `NONE` if no header is required.
23+
**-AddCredentials** If set to true the generated client will have ServiceClientCredentials property. A set of corresponding constructors will be generated and its ProcessHtppRequestAsync method will be called on the http requests. Users can derive from this class to add their customized authentication behaviors.
4524

46-
**-AddCredentials**
47-
If set to true the generated client will have [ServiceClientCredentials](https://github.com/Azure/AutoRest/blob/master/Microsoft.Rest/ClientRuntime/ServiceClientCredentials.cs) property. A set of corresponding constructors will be generated and its `ProcessHtppRequestAsync` method will be called on the http requests. Users can derive from this class to add their customized authentication behaviors.
4825

4926

5027
##Examples
51-
- Generate C# client library from a Swagger formatted input specification `swagger.json` with namespace `MyNamespace`:
28+
- Generate C# client library from a Swagger formatted input specification swagger.json with namespace MyNamespace:
5229
```bash
5330
AutoRest.exe -CodeGenerator CSharp -Modeler Swagger -Input swagger.json -BaseNamespace MyNamespace
5431
```
55-
This will generate all the C# files for corresponding operations in the `Generated` directory.
5632

57-
- Generate C# client library from a Swagger formatted input specification `swagger.json` with namespace `MyNamespace` into one single file `client.cs` with a customized header:
33+
- Generate C# client library from a Swagger formatted input specification swagger.json with namespace MyNamespace into one single file client.cs with a customized header:
5834
```bash
5935
AutoRest.exe -CodeGenerator CSharp -OutputAsSingleFile client.cs -Modeler Swagger -Input swagger.json -BaseNamespace MyNamespace -Header "Copyright Contoso Ltd"
6036
```
61-
This will generate one single file `client.cs` in the `Generated` directory.
6237

63-
- Generate C# client library from a Swagger formatted input specification `swagger.json` with namespace `MyNamespace` with credential property added:
38+
- Generate C# client library from a Swagger formatted input specification swagger.json with namespace MyNamespace with credential property added:
6439
```bash
6540
AutoRest.exe -CodeGenerator CSharp -Modeler Swagger -Input swagger.json -BaseNamespace MyNamespace -AddCredentials true
66-
```
41+
```

0 commit comments

Comments
 (0)