title: F# Parse command line arguments, expected incomplete structured construct at or before this point ; or ;;
body: <p>I have a basic F# CLI that mimics F# touch command , my program takes a file name , creates the file if it exists or updates access time if it doesn't.</p>
  
  <p>Core functionality is done, but it is supposed to mimic Linux' command Touch in terms of syntax. The syntax should be 'touch file1.text' for file creation or 'touch --version' for a message I want to print when option is given.</p>
  
  <p>My core problems are:-
  1. Having my code follow Linux' syntax - </p>
  
  <p>Current - >>>Test.text = File created.</p>
  
  <p>Expected - >>> touch test.txt or </p>
  
  <p>touch --version = File created or touch command information printed.</p>
  
  <ol start="2">
  <li>Taking --version and --help or similar valid input and printed the corresponding information.</li>
  </ol>
  
  <p>Current result </p>
  
  <blockquote>
    <p>test.txt // File created
    0 // </p>
  </blockquote>
  
  <p>Expected</p>
  
  <blockquote>
    <p>touch test.text //file created
    0 //
    or
    Expected
    touch --version / touch --help
    /* Touch information
    Touch information
    Touch information
    Touch information*/</p>
  </blockquote>
  
  <p>Tried using the Argu library but seems out of my current scope, currently attempting with argument parser module.</p>
  
  <pre><code>// Learn more about F# at http://fsharp.org
  
  open System
  open System.IO
  open System.Text
  
  type filename = String
  
  
  let touch path =
     //Console.ReadLine()
      if File.Exists path
      then File.SetLastWriteTime(path, DateTime.Now) 
      else 
           if not(File.Exists path)
           then File.WriteAllText(path, " ")
           Console.ReadKey()|&gt;ignore
  
  
  
  
  
  [&lt;EntryPoint&gt;]
      let main argv =
          printfn "Touch Command - Built using F#"
          printfn "Please enter the file you want to touch"
          if argv |&gt; Array.contains "Help " then 
                 printfn "Display help here"
                 exit(0)
                 printfn "Version information"
                 exit(0)
          for filename in argv do
              touch(filename)
          0    
          // return an integer exit code
  
  
  
       ```
  
  Current result 
  &gt; test.txt // File created
  &gt; 0 // internal 
  
  Expected
  &gt;touch test.text //file created
  &gt;0 //internal
  
  or
  Expected
  &gt;touch --version / touch --help
  &gt;/* Touch information
  Touch information
  Touch information
  Touch information*/
  
  No current errors
  When argu library attempted, to many errors to bring to solution board.
  </code></pre>