Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix help text
  • Loading branch information
dsyme committed Feb 19, 2019
commit b57faa5b1860bc17634b984e6a94d6f0ae3e63fb
8 changes: 7 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,12 @@ if not exist "%link_exe%" (
if /I not "%single_threaded%" == "true" (set PARALLEL_ARG=-procs:%NUMBER_OF_PROCESSORS%) else set PARALLEL_ARG=-procs:0

set FSCBINPATH=%~dp0artifacts\bin\fsc\%BUILD_CONFIG%\net46
set FSIANYCPUBINPATH=%~dp0artifacts\bin\fsiAnyCpu\%BUILD_CONFIG%\net46
set FSIBINPATH=%~dp0artifacts\bin\fsi\%BUILD_CONFIG%\net46

ECHO FSCBINPATH=%FSCBINPATH%
ECHO FSIANYCPUBINPATH=%FSIANYCPUBINPATH%
ECHO FSIBINPATH=%FSIBINPATH%
ECHO link_exe=%link_exe%

REM ---------------- test-net40-fsharp -----------------------
Expand Down Expand Up @@ -876,8 +880,10 @@ if "%TEST_NET40_FSHARPQA_SUITE%" == "1" (

set CSC_PIPE=%USERPROFILE%\.nuget\packages\Microsoft.Net.Compilers\2.7.0\tools\csc.exe
set FSC=!FSCBINPATH!\fsc.exe
set FSI=!FSIBINPATH!\fsi.exe
set FSIANYCPU=!FSIANYCPUBINPATH!\fsi.exe
set FSCOREDLLPATH=!FSCBinPath!\FSharp.Core.dll
set PATH=!FSCBINPATH!;!PATH!
set PATH=!FSCBINPATH!;!FSIBINPATH!;!FSIANYCPUBINPATH!;!PATH!
set perlexe=%USERPROFILE%\.nuget\packages\StrawberryPerl64\5.22.2.1\Tools\perl\bin\perl.exe
if not exist !perlexe! (echo Error: perl was not downloaded from check the packages directory: !perlexe! && goto :failure )

Expand Down
4 changes: 1 addition & 3 deletions src/fsharp/CompileOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ let compilerOptionUsage (CompilerOption(s,tag,spec,_,_)) =
| OptionGeneral _ -> if tag="" then sprintf "%s" s else sprintf "%s:%s" s tag (* still being decided *)

let PrintCompilerOption (CompilerOption(_s,_tag,_spec,_,help) as compilerOption) =
let flagWidth = 30 // fixed width for printing of flags, e.g. --warnaserror:<warn...>
let flagWidth = 42 // fixed width for printing of flags, e.g. --debug:{full|pdbonly|portable|embedded}
let defaultLineWidth = 80 // the fallback width
let lineWidth =
try
Expand All @@ -113,15 +113,13 @@ let PrintCompilerOption (CompilerOption(_s,_tag,_spec,_,help) as compilerOption)
// flagWidth chars - for flags description or padding on continuation lines.
// single space - space.
// description - words upto but excluding the final character of the line.
assert(flagWidth = 30)
printf "%-40s" (compilerOptionUsage compilerOption)
let printWord column (word:string) =
// Have printed upto column.
// Now print the next word including any preceding whitespace.
// Returns the column printed to (suited to folding).
if column + 1 (*space*) + word.Length >= lineWidth then // NOTE: "equality" ensures final character of the line is never printed
printfn "" (* newline *)
assert(flagWidth = 30)
printf "%-40s %s" ""(*<--flags*) word
flagWidth + 1 + word.Length
else
Expand Down
37 changes: 18 additions & 19 deletions tests/fsharpqa/Source/CompilerOptions/fsc/help/comparer.fsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
// #NoMT #CompilerOptions #RequiresENU
#light

let arg0 = System.Environment.GetCommandLineArgs().[0]
let path = System.Environment.GetEnvironmentVariable("PATH")
let fn1 = fsi.CommandLineArgs.[1]
let fn2 = fsi.CommandLineArgs.[2]

// Read file into an array
let File2List (filename:string) =
use s = new System.IO.StreamReader(filename)
let mutable l = []
while not s.EndOfStream do
l <- List.append l ( s.ReadLine() :: [])
l
let File2List (filename:string) = System.IO.File.ReadAllLines(filename)

let f1 = File2List fn1
let f2 = File2List fn2

let mutable i = 0
let compare (f1:string list) (f2:string list) = List.forall2 (fun (a:string) (b:string) ->
let aa = System.Text.RegularExpressions.Regex.Replace(a, @"F# Compiler version .+", "F# Compiler")
let bb = System.Text.RegularExpressions.Regex.Replace(b, @"F# Compiler version .+", "F# Compiler")
let compare (f1:string[]) (f2:string[]) =
if f1.Length <> f2.Length then failwithf "Help text did not match. f1.Length = %d, f2.Length = %d. Check you have fsc on path, arg0 = %s, PATH=%s" f1.Length f2.Length arg0 path
(f1, f2) ||> Array.forall2 (fun (a:string) (b:string) ->
let aa = System.Text.RegularExpressions.Regex.Replace(a, @"F# Compiler version .+", "F# Compiler")
let bb = System.Text.RegularExpressions.Regex.Replace(b, @"F# Compiler version .+", "F# Compiler")
i <- i+1
if (aa = bb) then
true
else
printfn "Files differ at line %d:" i
printfn "\t>> %s" a
printfn "\t<< %s" b
false
)

i <- i+1
if (aa = bb) then
true
else
printfn "Files differ at line %d:" i
printfn "\t>> %s" a
printfn "\t<< %s" b
false
) f1 f2
exit (if compare f1 f2 then 0 else 1)

exit (if (f1.Length = f2.Length && compare f1 f2) then 0 else printfn "File lengths differ"; 1)
170 changes: 98 additions & 72 deletions tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl
Original file line number Diff line number Diff line change
@@ -1,121 +1,147 @@
Microsoft (R) F# Compiler version 3.0
Microsoft (R) F# Compiler version 10.2.3 for F# 4.5
Copyright (c) Microsoft Corporation. All Rights Reserved.


- OUTPUT FILES -
--out:<file> Name of the output file (Short form: -o)
--out:<file> Name of the output file (Short form:
-o)
--target:exe Build a console executable
--target:winexe Build a Windows executable
--target:library Build a library (Short form: -a)
--target:module Build a module that can be added to another
assembly
--delaysign[+|-] Delay-sign the assembly using only the public
portion of the strong name key
--publicsign[+|-] Public-sign the assembly using only the public
portion of the strong name key, and mark the
assembly as signed
--doc:<file> Write the xmldoc of the assembly to the given
file
--target:module Build a module that can be added to
another assembly
--delaysign[+|-] Delay-sign the assembly using only
the public portion of the strong
name key
--publicsign[+|-] Public-sign the assembly using only
the public portion of the strong
name key, and mark the assembly as
signed
--doc:<file> Write the xmldoc of the assembly to
the given file
--keyfile:<file> Specify a strong name key file
--keycontainer:<string> Specify a strong name key container
--platform:<string> Limit which platforms this code can run on: x86,
Itanium, x64, anycpu32bitpreferred, or anycpu.
The default is anycpu.
--nooptimizationdata Only include optimization information essential
for implementing inlined constructs. Inhibits
cross-module inlining but improves binary
compatibility.
--nointerfacedata Don't add a resource to the generated assembly
containing F#-specific metadata
--sig:<file> Print the inferred interface of the assembly to
a file
--nocopyfsharpcore Don't copy FSharp.Core.dll along the produced
binaries
--platform:<string> Limit which platforms this code can
run on: x86, Itanium, x64,
anycpu32bitpreferred, or anycpu. The
default is anycpu.
--nooptimizationdata Only include optimization
information essential for
implementing inlined constructs.
Inhibits cross-module inlining but
improves binary compatibility.
--nointerfacedata Don't add a resource to the
generated assembly containing
F#-specific metadata
--sig:<file> Print the inferred interface of the
assembly to a file
--nocopyfsharpcore Don't copy FSharp.Core.dll along the
produced binaries


- INPUT FILES -
--reference:<file> Reference an assembly (Short form: -r)
--reference:<file> Reference an assembly (Short form:
-r)


- RESOURCES -
--win32res:<file> Specify a Win32 resource file (.res)
--win32manifest:<file> Specify a Win32 manifest file
--nowin32manifest Do not include the default Win32 manifest
--nowin32manifest Do not include the default Win32
manifest
--resource:<resinfo> Embed the specified managed resource
--linkresource:<resinfo> Link the specified resource to this assembly
where the resinfo format is <file>[,<string
--linkresource:<resinfo> Link the specified resource to this
assembly where the resinfo format is
<file>[,<string
name>[,public|private]]


- CODE GENERATION -
--debug[+|-] Emit debug information (Short form: -g)
--debug:{full|pdbonly|portable|embedded} Specify debugging type: full, portable,
embedded, pdbonly. ('full' is the default if no
debuggging type specified and enables attaching
a debugger to a running program, 'portable' is a
cross-platform format, 'embedded' is a
cross-platform format embedded into the output
file).
--embed[+|-] Embed all source files in the portable PDB file
--embed:<file;...> Embed specific source files in the portable PDB
file
--sourcelink:<file> Source link information file to embed in the
--debug[+|-] Emit debug information (Short form:
-g)
--debug:{full|pdbonly|portable|embedded} Specify debugging type: full,
portable, embedded, pdbonly. ('full'
is the default if no debuggging type
specified and enables attaching a
debugger to a running program,
'portable' is a cross-platform
format, 'embedded' is a
cross-platform format embedded into
the output file).
--embed[+|-] Embed all source files in the
portable PDB file
--embed:<file;...> Embed specific source files in the
portable PDB file
--optimize[+|-] Enable optimizations (Short form: -O)
--sourcelink:<file> Source link information file to
embed in the portable PDB file
--optimize[+|-] Enable optimizations (Short form:
-O)
--tailcalls[+|-] Enable or disable tailcalls
--deterministic[+|-] Produce a deterministic assembly (including
module version GUID and timestamp)
--crossoptimize[+|-] Enable or disable cross-module optimizations
--deterministic[+|-] Produce a deterministic assembly
(including module version GUID and
timestamp)
--crossoptimize[+|-] Enable or disable cross-module
optimizations


- ERRORS AND WARNINGS -
--warnaserror[+|-] Report all warnings as errors
--warnaserror[+|-]:<warn;...> Report specific warnings as errors
--warn:<n> Set a warning level (0-5)
--nowarn:<warn;...> Disable specific warning messages
--warnon:<warn;...> Enable specific warnings that may be off by
default
--consolecolors[+|-] Output warning and error messages in color
--warnon:<warn;...> Enable specific warnings that may be
off by default
--consolecolors[+|-] Output warning and error messages in
color


- LANGUAGE -
--checked[+|-] Generate overflow checks
--define:<string> Define conditional compilation symbols (Short
form: -d)
--define:<string> Define conditional compilation
symbols (Short form: -d)
--mlcompatibility Ignore ML compatibility warnings


- MISCELLANEOUS -
--nologo Suppress compiler copyright message
--help Display this usage message (Short form: -?)
--help Display this usage message (Short
form: -?)
--@<file> Read response file for more options


- ADVANCED -
--codepage:<n> Specify the codepage used to read source files
--codepage:<n> Specify the codepage used to read
source files
--utf8output Output messages in UTF-8 encoding
--preferreduilang:<string> Specify the preferred output language culture
name (e.g. es-ES, ja-JP)
--fullpaths Output messages with fully qualified paths
--lib:<dir;...> Specify a directory for the include path which
is used to resolve source files and assemblies
(Short form: -I)
--preferreduilang:<string> Specify the preferred output
language culture name (e.g. es-ES,
ja-JP)
--fullpaths Output messages with fully qualified
paths
--lib:<dir;...> Specify a directory for the include
path which is used to resolve source
files and assemblies (Short form:
-I)
--simpleresolution Resolve assembly references using
directory-based rules rather than MSBuild
resolution
--targetprofile:<string> Specify target framework profile of this
assembly. Valid values are mscorlib, netcore or
netstandard. Default - mscorlib
--baseaddress:<address> Base address for the library to be built
--noframework Do not reference the default CLI assemblies by
default
--standalone Statically link the F# library and all
referenced DLLs that depend on it into the
assembly being generated
--staticlink:<file> Statically link the given assembly and all
referenced DLLs that depend on this assembly.
Use an assembly name e.g. mylib, not a DLL name.
directory-based rules rather than
MSBuild resolution
--targetprofile:<string> Specify target framework profile of
this assembly. Valid values are
mscorlib, netcore or netstandard.
Default - mscorlib
--baseaddress:<address> Base address for the library to be
built
--noframework Do not reference the default CLI
assemblies by default
--standalone Statically link the F# library and
all referenced DLLs that depend on
it into the assembly being generated
--staticlink:<file> Statically link the given assembly
and all referenced DLLs that depend
on this assembly. Use an assembly
name e.g. mylib, not a DLL name.
--pdb:<string> Name the output debug file
--highentropyva[+|-] Enable high-entropy ASLR
--subsystemversion:<string> Specify subsystem version of this assembly
--subsystemversion:<string> Specify subsystem version of this
assembly
--quotations-debug[+|-] Emit debug information in quotations
Loading