Sha256: 2c8916e36e8be5f7e34298ef10324cccb23aff6526fd88fbd52f288abd7dd847

Contents?: true

Size: 961 Bytes

Versions: 7

Compression:

Stored size: 961 Bytes

Contents

module Library

open Argu

type CLIArguments =
  | Working_Directory of path:string
  | Listener of host:string * port:int
  | Data of base64:byte[]
  | Port of tcp_port:int
  | Log_Level of level:int
  | Detach
with
  interface IArgParserTemplate with
    member s.Usage =
      match s with
      | Working_Directory _ -> "specify a working directory."
      | Listener _ -> "specify a listener (hostname : port)."
      | Data _ -> "binary data in base64 encoding."
      | Port _ -> "specify a primary port."
      | Log_Level _ -> "set the log level."
      | Detach _ -> "detach daemon from console."

let libraryMain argv =
  let parser = ArgumentParser.Create<CLIArguments>(programName = "ConsoleArgu.exe")
  let results = parser.Parse(argv, raiseOnUsage = false)
  if results.IsUsageRequested then
    printfn "%s" (parser.PrintUsage())
  else
    let all = results.GetAllResults() // [ Detach ; Listener ("localhost", 8080) ]
    printfn "%A" all
  0

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
albacore-3.0.1 spec/testdata/console-core-argu/Library.fs
albacore-3.0.0.pre.alpha.6 spec/testdata/console-core-argu/Library.fs
albacore-3.0.0.pre.alpha.5 spec/testdata/console-core-argu/Library.fs
albacore-3.0.0.pre.alpha.4 spec/testdata/console-core-argu/Library.fs
albacore-3.0.0.pre.alpha.3 spec/testdata/console-core-argu/Library.fs
albacore-3.0.0.pre.alpha.2 spec/testdata/console-core-argu/Library.fs
albacore-3.0.0.pre.alpha spec/testdata/console-core-argu/Library.fs