summaryrefslogblamecommitdiff
path: root/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
blob: b9e9a14adf63936d1327ab365b673f8f0ac190f0 (plain) (tree)
1
2
3
4
5
6
7
8
9
                            
                                


                     
                       
 

                                    
                                                                            
                                                   
 

                  
                  
            
                                      
                                               
              
 

                       


                                                              


                  



                                 
 
            
                   

                                                                                                 
 



                                                                               

                                                                    
 
/* NSC -- new Scala compiler
 * Copyright 2006-2011 LAMP/EPFL
 * @author  Lex Spoon
 */

package scala.tools.nsc

import scala.tools.util.PathResolver

class GenericRunnerSettings(error: String => Unit) extends Settings(error) {
  def classpathURLs = new PathResolver(this) asURLs

  val howtorun =
    ChoiceSetting(
      "-howtorun",
      "how",
      "how to run the specified code",
      List("object", "script", "jar", "guess"),
      "guess")

  val loadfiles =
    MultiStringSetting(
      "-i",
      "file",
      "load a file (assumes the code is given interactively)")

  val execute =
    StringSetting(
      "-e",
      "string",
      "execute a single command",
      "")

  val save =
    BooleanSetting(
      "-save",
      "save the compiled script (assumes the code is a script)") withAbbreviation "-savecompiled"

  val nc = BooleanSetting(
      "-nc",
      "do not use the fsc compilation daemon") withAbbreviation "-nocompdaemon"

  @deprecated("Use `nc` instead", "2.9.0") def nocompdaemon = nc
  @deprecated("Use `save` instead", "2.9.0") def savecompiled = save
}