File: Arg.fsi

package info (click to toggle)
fsharp 3.1.1.26%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 59,244 kB
  • ctags: 4,190
  • sloc: cs: 13,398; ml: 1,098; sh: 399; makefile: 293; xml: 82
file content (50 lines) | stat: -rwxr-xr-x 1,983 bytes parent folder | download
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
// (c) Microsoft Corporation 2005-2009. 

/// A simple command-line argument processor.
#if INTERNALIZED_POWER_PACK
namespace Internal.Utilities
#else
namespace Microsoft.FSharp.Text
#endif

/// The spec value describes the action of the argument,
/// and whether it expects a following parameter.
[<Sealed>]
type ArgType = 
    static member Clear  : bool ref         -> ArgType
    static member Float  : (float -> unit)  -> ArgType
    static member Int    : (int -> unit)    -> ArgType
    static member Rest   : (string -> unit) -> ArgType
    static member Set    : bool ref         -> ArgType
    static member String : (string -> unit) -> ArgType
    static member Unit   : (unit -> unit)   -> ArgType

type ArgInfo = 
  new : name:string * action:ArgType * help:string -> ArgInfo
  /// Return the name of the argument
  member Name : string
  /// Return the argument type and action of the argument
  member ArgType : ArgType
  /// Return the usage help associated with the argument
  member HelpText : string

[<Sealed>]
type ArgParser = 
    #if FX_NO_COMMAND_LINE_ARGS
    #else

    /// Parse some of the arguments given by 'argv', starting at the given position
    [<System.Obsolete("This method should not be used directly as it will be removed in a future revision of this library")>]
    static member ParsePartial: cursor: int ref * argv: string[] * arguments:seq<ArgInfo> * ?otherArgs: (string -> unit) * ?usageText:string -> unit

    /// Parse the arguments given by System.Environment.GetEnvironmentVariables()
    /// according to the argument processing specifications "specs".
    /// Args begin with "-". Non-arguments are passed to "f" in
    /// order.  "use" is printed as part of the usage line if an error occurs.

    static member Parse: arguments:seq<ArgInfo> * ?otherArgs: (string -> unit) * ?usageText:string -> unit
    #endif

    /// Prints the help for each argument.
    static member Usage : arguments:seq<ArgInfo> * ?usage:string -> unit