Browse Source

Created console commands file in core version.

master
Craig Oates 4 years ago
parent
commit
01bb68200d
  1. 5
      BrittleFishCore/BrittleFishCore.fsproj
  2. 48
      BrittleFishCore/ConsoleCommands.fs
  3. 11
      BrittleFishCore/Program.fs

5
BrittleFishCore/BrittleFishCore.fsproj

@ -6,7 +6,12 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="ConsoleCommands.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Console.Waterworks.Core" Version="1.0.0-alpha" />
</ItemGroup>
</Project>

48
BrittleFishCore/ConsoleCommands.fs

@ -0,0 +1,48 @@
namespace Commands
module ConsoleCommands =
open System
open Console.Waterworks.Core
open Console.Waterworks.Core.Attributes
open FunkyFish // This is where the "LibraryTest" functions are -- in BFLib
[<ListCommand>]
[<Description "Display a message to the console signifying the program is running as intended.">]
[<Parameters "none">]
[<Usage "> test">]
let test() = "The console is working"
[<ListCommand>]
[<Description "Closes the program.">]
[<Parameters "none">]
[<Usage "> exit">]
let exit() = System.Environment.Exit(Environment.ExitCode)
[<ListCommand>]
[<Description "Display a list of available commands, info. about the command, its parameters and an example of how to use it.">]
[<Parameters "None">]
[<Usage "> help">]
let help() =
let liaison = CW_Liaison()
liaison.RequestHelpDocumentation("Commands")
(*
[<ListCommand>]
[<Description "Adds the two numbers together.">]
[<Parameters "x:int y:int">]
[<Usage "> libtest1 5 10">]
let libtest1 x y = String.Format("Result: {0}" , LibraryTest1 x y)
[<ListCommand>]
[<Description "Multiplies x and y together then mulitplies that by z or... (x * y) * z">]
[<Parameters "x:int y:int z:int">]
[<Usage "> libtest2 5 10 2">]
let libtest2 x y z = String.Format("Result: {0}", (LibraryTest2 x y z))
[<ListCommand>]
[<Description "Appends the named passed into the console onto \"Hello\" and displays it in the console.">]
[<Parameters "name: string">]
[<Usage "> libtest3 \"Craig Oates\"">]
let libtest3 name = String.Format("Result: {0}", LibraryTest3 name)
*)

11
BrittleFishCore/Program.fs

@ -1,8 +1,7 @@
// Learn more about F# at http://fsharp.org
open System
open Console.Waterworks.Core
[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
0 // return an integer exit code
let main argv =
let liaison = CW_Liaison()
liaison.Run("Commands", true)
0
Loading…
Cancel
Save