forked from commandlineparser/commandline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.fsx
More file actions
75 lines (50 loc) · 1.92 KB
/
index.fsx
File metadata and controls
75 lines (50 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
(*** hide ***)
// This block of code is omitted in the generated HTML documentation. Use
// it to define helpers that you do not want to show in the documentation.
#I "../../build"
#r "CommandLine.dll"
open System
(**
# Command Line Parser Library
Terse syntax C# command line parser for .NET with F# support.
<div class="row">
<div class="span1"></div>
<div class="span6">
<div class="well well-small" id="nuget">
CommandLineParser can be <a href="https://nuget.org/packages/CommandLineParser">installed from NuGet</a>:
<pre>PM> Install-Package CommandLineParser -Pre</pre>
</div>
</div>
<div class="span1"></div>
</div>
## Introduction
The library parses command line arguments to a record decorated with attributes:
*)
type options = {
[<Option>] files : seq<string>;
[<Option>] verbose : bool;
[<Option>] offset : int64 option;
}
(**
Previous record defines the above parsing scheme:
[lang=bash]
--files file1.bin file2.txt file3.xml --verbose --offset 11
and it will be used to build up this record instance:
*)
{ files = seq { yield "file1.bin"; yield "file2.txt"; yield "file3.xml"}; verbose = true; offset = Some 11L }
(**
## Who uses CommandLineParser?
* [FSharp.Formatting](http://tpetricek.github.io/FSharp.Formatting/)
* Various commercial products
## Documentation
* [Tutorial](tutorial.html) A short walkthrough of CommandLineParser features.
* [GitHub Wiki](https://github.com/gsscoder/commandline/wiki/Latest-Version)
## Contributing and copyright
The project is hosted on [GitHub][gh] where you can [report issues][issues], fork
the project and submit pull requests.
The library is available under the MIT License.
For more information see the [License file][license] in the GitHub repository.
[gh]: https://github.com/gsscoder/commandline
[issues]: https://github.com/gsscoder/commandline/issues
[license]: https://github.com/gsscoder/commandline/blob/master/License.md
*)