Skip to content

Commit

Permalink
Merge pull request #759 from nojaf/trim-fsc-options
Browse files Browse the repository at this point in the history
Trim --fscoptions.
  • Loading branch information
dsyme authored Aug 5, 2022
2 parents 9cb0c7d + 2c01c61 commit a55c29b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 15.0.2
* Trim the `--fscoptions` before passing them as `otherflags`. ([comment #616](https://github.com/fsprojects/FSharp.Formatting/issues/616#issuecomment-1200877765))

## 15.0.1
* fix https://github.com/fsprojects/FSharp.Formatting/issues/749

Expand Down
4 changes: 2 additions & 2 deletions docs/apidocs.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ Example as last line:
/// [omit]
module Bar =
let a = 42

(**
Example as first line:
*)

/// [omit]
/// Some actual comment
module Bar` =
module Bar2 =
let a = 42

(**
Expand Down
35 changes: 18 additions & 17 deletions docs/commandline.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ rules of [API doc generation](apidocs.html). The input accepted is described in

The command line options accepted are:

| Command Line Option | Description |
|:-----------------------|:-----------------------------------------|
| `--input` | Input directory of content (default: `docs`) |
| `--projects` | Project files to build API docs for outputs, defaults to all packable projects |
| `--output` | Output Directory (default 'output' for 'build' and 'tmp/watch' for 'watch') |
| `--noapidocs` | Disable generation of API docs |
| `--eval` | Evaluate F# fragments in scripts |
| `--saveimages` | Save images referenced in docs |
| `--nolinenumbers` | Don't add line numbers, default is to add line number. |
| `--parameters` | Additional substitution parameters for templates |
| `--nonpublic` | The tool will also generate documentation for non-public members |
| `--nodefaultcontent` | Do not copy default content styles, javascript or use default templates |
| `--clean` | Clean the output directory |
| `--help` | Display this help screen |
| `--version` | Display version information |
| `--properties` | Provide properties to dotnet msbuild, e.g. --properties Configuration=Release Version=3.4 |
| `--strict` | Fail if docs are missing or can't be generated |
| Command Line Option | Description |
|:---------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--input` | Input directory of content (default: `docs`) |
| `--projects` | Project files to build API docs for outputs, defaults to all packable projects |
| `--output` | Output Directory (default 'output' for 'build' and 'tmp/watch' for 'watch') |
| `--noapidocs` | Disable generation of API docs |
| `--eval` | Evaluate F# fragments in scripts |
| `--saveimages` | Save images referenced in docs |
| `--nolinenumbers` | Don't add line numbers, default is to add line number. |
| `--parameters` | Additional substitution parameters for templates |
| `--nonpublic` | The tool will also generate documentation for non-public members |
| `--nodefaultcontent` | Do not copy default content styles, javascript or use default templates |
| `--clean` | Clean the output directory |
| `--help` | Display this help screen |
| `--version` | Display version information |
| `--properties` | Provide properties to dotnet msbuild, e.g. --properties Configuration=Release Version=3.4 |
| `--fscoptions` | Additional arguments passed down as `otherflags` to the F# compiler when the API is being generated.<br/>Note that these arguments are trimmed, this is to overcome [a limitation in the command line argument processing](https://github.com/commandlineparser/commandline/issues/58).<br/>A typical use-case would be to pass an addition assembly reference.<br/>Example `--fscoptions " -r:MyAssembly.dll"` |
| `--strict` | Fail if docs are missing or can't be generated |

The following command line options are also accepted but it is instead recommended you use
settings in your .fsproj project files:
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Formatting.ApiDocs/GenerateModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@ type ApiDocModel internal (substitutions, collection, entityInfos, root, qualify

// Default template file names

let otherFlags = defaultArg otherFlags []
let otherFlags = defaultArg otherFlags [] |> List.map (fun (o: string) -> o.Trim())

let libDirs = defaultArg libDirs [] |> List.map Path.GetFullPath

Expand Down

0 comments on commit a55c29b

Please sign in to comment.