Proposed How to read command line arguements

  • Wednesday, January 02, 2013 12:11 AM
     
      Has Code

    I found this code somewhere (I lost the URL) and I would like to make it work for both fsi.exe and fsc.exe. It seems to work OK for fsi.exe. How can I make to work for fsc.exe too?

    let argv = 
    #if INTERACTIVE
      fsi.CommandLineArgs
    #else
      Sys.argv
    #endif
    

    I keep getting errors from fsc.exe when I try to compile it. Where is this magical array Sys.argv defined?

    Also: is there a command line argument for fsi that will make it execute a file with the extension of .fs or do I have to rename it to have an extension of .fsx?


    siegfried heintze

All Replies