Browse Source

Wired the BFLib functions into the command-methods.

master
Craig Oates 6 years ago
parent
commit
7822f58ae3
  1. 2
      BFLib/BFLib.fsproj
  2. 4
      BFLib/FunkyFish.fs
  3. 4
      BFLib/Library1.fs
  4. 6
      BFLib/Script.fsx
  5. 9
      BrittleFish/ConsoleCommands.fs

2
BFLib/BFLib.fsproj

@ -52,7 +52,7 @@
<Import Project="$(FSharpTargetsPath)" /> <Import Project="$(FSharpTargetsPath)" />
<ItemGroup> <ItemGroup>
<Compile Include="AssemblyInfo.fs" /> <Compile Include="AssemblyInfo.fs" />
<Compile Include="Library1.fs" /> <Compile Include="FunkyFish.fs" />
<None Include="Script.fsx" /> <None Include="Script.fsx" />
<Content Include="packages.config" /> <Content Include="packages.config" />
</ItemGroup> </ItemGroup>

4
BFLib/FunkyFish.fs

@ -0,0 +1,4 @@
module FunkyFish
let LibraryTest1 x y = x + y
let LibraryTest2 x y z = (x * y) * z
let LibraryTest3 name = "Hello " + name

4
BFLib/Library1.fs

@ -1,4 +0,0 @@
namespace BFLib
type Class1() =
member this.X = "F#"

6
BFLib/Script.fsx

@ -1,8 +1,8 @@
// Learn more about F# at http://fsharp.org // Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help. // See the 'F# Tutorial' project for more help.
#load "Library1.fs" #load "FunkyFish.fs"
open BFLib open FunkyFish
// Define your library scripting code here // Feel free to add your own code in here...

9
BrittleFish/ConsoleCommands.fs

@ -4,6 +4,7 @@
open System open System
open Console.Waterworks open Console.Waterworks
open Console.Waterworks.Attributes open Console.Waterworks.Attributes
open FunkyFish // This is where the "LibraryTest" functions are -- in BFLib
[<ListCommand>] [<ListCommand>]
[<Description "Display a message to the console signifying the program is running as intended.">] [<Description "Display a message to the console signifying the program is running as intended.">]
@ -25,3 +26,11 @@
let liaison = CW_Liaison() let liaison = CW_Liaison()
liaison.RequestHelpDocumentation("Commands") liaison.RequestHelpDocumentation("Commands")
let libtest1 x y = String.Format("Result: {0}" , LibraryTest1 x y)
let libtest2 x y z = String.Format("Result: {0}", (LibraryTest2 x y z))
let libtest3 name = String.Format("Result: {0}", LibraryTest3 name)

Loading…
Cancel
Save