aboutsummaryrefslogblamecommitdiff
path: root/stage2/plugins/CommandLineOverrides.scala
blob: 3ffaf21a72b91d05973cd9f8a1fd72a654e5007c (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                                    
                       





                                             
            

                                               
     

              
                       



                                                                       
            

                   
     

   
package cbt
trait CommandLineOverrides extends DynamicOverrides{
  def `with`: Any = {
    lib.callReflective(
      newBuild[DynamicOverrides](
        context.copy(
          args = context.args.drop(2)
        )
      )( s"""
        ${context.args.lift(0).getOrElse("")}
      """ ),
      context.args.lift(1) orElse Some("void"),
      context
    )
  }
  def eval = {
    lib.callReflective(
      newBuild[CommandLineOverrides](
        context.copy(
          args = ( context.args.lift(0).map("println{ "+_+" }") ).toSeq
        )
      ){""},
      Some("with"),
      context
    )
  }
}