anchor.diff:  
       open Fake
       open System
  -    open System.Reflection
  -    open Microsoft.FSharp.Reflection
  -
   
       // ************************************************************************
       // TYPES
  
positive.code:         let octoParams = setParams(octoParams)
          let command = (octoParams.Command.ToString())
          let tool = octoParams.ToolPath @@ octoParams.ToolName
          let args = (commandString octoParams.Command) + (commandLine octoParams.Server)    
  
          traceStartTask "Octo " command       
          trace (tool + args)
  
negative.code:     // ************************************************************************
      // HELPER FUNCTIONS
  
      let optionalStringParam p o = 
          match o with
          | Some s -> sprintf " --%s=\"%s\"" p s
          | None -> ""
  
      let optionalObjParam p o = 
          match o with
          | Some x -> sprintf " --%s=\"%s\"" p (x.ToString())
          | None -> ""    
      
      let liftString x = 
          if String.IsNullOrEmpty x then None
          else Some x      
  
      let flag p b = if b then sprintf " --%s" p else ""
      
      let releaseCommandLine (opts:CreateReleaseOptions) =
          [ (optionalStringParam "projects" (liftString opts.Project))
            (optionalStringParam "version" (liftString opts.Version))
            (optionalStringParam "packageversion" (liftString opts.PackageVersion))
            (optionalStringParam "packageversionoverride" opts.PackageVersionOverride)
            (optionalStringParam "packagesfolder" opts.PackagesFolder)
            (optionalStringParam "releasenotes" (liftString opts.ReleaseNotes))
            (optionalStringParam "releasenotesfile" (liftString opts.ReleaseNotesFile)) ] 
          |> List.fold (+) ""
  
      let deployCommandLine (opts:DeployReleaseOptions) = 
          [ (optionalStringParam "project" (liftString opts.Project))
            (optionalStringParam "deployto" (liftString opts.DeployTo))
            (optionalStringParam "version" (liftString opts.Version))
            (flag "force" opts.Force)
            (flag "waitfordeployment" opts.WaitForDeployment)
            (optionalObjParam "deploymenttimeout" opts.DeploymentTimeout)
            (optionalObjParam "deploymentchecksleepcycle" opts.DeploymentCheckSleepCycle) ] 
          |> List.fold (+) ""
  
      let deleteCommandLine (opts:DeleteReleaseOptions) =
          [ (optionalStringParam "project" (liftString opts.Project))
            (optionalStringParam "minversion" (liftString opts.MinVersion))
            (optionalStringParam "maxversion" (liftString opts.MaxVersion)) ] 
          |> List.fold (+) ""
  
      let serverCommandLine (opts:OctoServerOptions) = 
          [ (optionalStringParam "server=\"%s\"" (liftString opts.Server))
            (optionalStringParam "apikey=\"%s\"" (liftString opts.ApiKey)) ] 
          |> List.fold (+) ""
  
      /// Maps an command to string input for the octopus tools cli.
      let commandLine command =       
          match command with
          | CreateRelease (opts, None) ->        
              sprintf " create-release%s" (releaseCommandLine opts)
          | CreateRelease (opts, Some (dopts)) ->
              sprintf " create-release%s%s" (releaseCommandLine opts) (deployCommandLine dopts)
          | DeployRelease opts ->
              sprintf " deploy-release%s" (deployCommandLine opts)
          | DeleteRelease opts ->
              sprintf " delete-releases%s" (deleteCommandLine opts)
          | ListEnvironments -> 
              " list-environments"
  
  