src/Pure/System/build.scala
changeset 48346 e2382bede914
parent 48344 8dc904c45945
child 48347 8bb27ab9e841
     1.1 --- a/src/Pure/System/build.scala	Thu Jul 19 11:54:19 2012 +0200
     1.2 +++ b/src/Pure/System/build.scala	Thu Jul 19 12:05:54 2012 +0200
     1.3 @@ -159,40 +159,22 @@
     1.4    }
     1.5  
     1.6  
     1.7 -
     1.8 -  /** command line entry point **/
     1.9 -
    1.10 -  private object Chunks
    1.11 -  {
    1.12 -    private def chunks(list: List[String]): List[List[String]] =
    1.13 -      list.indexWhere(_ == "\n") match {
    1.14 -        case -1 => List(list)
    1.15 -        case i =>
    1.16 -          val (chunk, rest) = list.splitAt(i)
    1.17 -          chunk :: chunks(rest.tail)
    1.18 -      }
    1.19 -    def unapplySeq(list: List[String]): Option[List[List[String]]] = Some(chunks(list))
    1.20 -  }
    1.21 +  /* command line entry point */
    1.22  
    1.23    def main(args: Array[String])
    1.24    {
    1.25 -    val rc =
    1.26 -      try {
    1.27 -        args.toList match {
    1.28 -          case
    1.29 -            Properties.Value.Boolean(all_sessions) ::
    1.30 -            Properties.Value.Boolean(build_images) ::
    1.31 -            Properties.Value.Boolean(list_only) ::
    1.32 -            Chunks(more_dirs, options, sessions) =>
    1.33 -              build(all_sessions, build_images, list_only,
    1.34 -                more_dirs.map(Path.explode), options, sessions)
    1.35 -          case _ => error("Bad arguments:\n" + cat_lines(args))
    1.36 -        }
    1.37 +    Command_Line.tool {
    1.38 +      args.toList match {
    1.39 +        case
    1.40 +          Properties.Value.Boolean(all_sessions) ::
    1.41 +          Properties.Value.Boolean(build_images) ::
    1.42 +          Properties.Value.Boolean(list_only) ::
    1.43 +          Command_Line.Chunks(more_dirs, options, sessions) =>
    1.44 +            build(all_sessions, build_images, list_only,
    1.45 +              more_dirs.map(Path.explode), options, sessions)
    1.46 +        case _ => error("Bad arguments:\n" + cat_lines(args))
    1.47        }
    1.48 -      catch {
    1.49 -        case exn: Throwable => java.lang.System.err.println(Exn.message(exn)); 2
    1.50 -      }
    1.51 -    sys.exit(rc)
    1.52 +    }
    1.53    }
    1.54  }
    1.55