Lines Matching refs:opt
36 private def is_option(opt: Char): Boolean = options.isDefinedAt(opt)
37 private def is_option0(opt: Char): Boolean = is_option(opt) && !options(opt)._1
38 private def is_option1(opt: Char): Boolean = is_option(opt) && options(opt)._1
39 private def print_option(opt: Char): String = quote("-" + opt.toString)
40 private def option(opt: Char, opt_arg: List[Char]): Unit =
41 try { options(opt)._2.apply(opt_arg.mkString) }
44 cat_error(msg, "The error(s) above occurred in command-line option " + print_option(opt))
50 case ('-' :: opt :: rest_opts) :: rest_args if is_option0(opt) && !rest_opts.isEmpty =>
51 option(opt, Nil); getopts(('-' :: rest_opts) :: rest_args)
52 case List('-', opt) :: rest_args if is_option0(opt) =>
53 option(opt, Nil); getopts(rest_args)
54 case ('-' :: opt :: opt_arg) :: rest_args if is_option1(opt) && !opt_arg.isEmpty =>
55 option(opt, opt_arg); getopts(rest_args)
56 case List('-', opt) :: opt_arg :: rest_args if is_option1(opt) =>
57 option(opt, opt_arg); getopts(rest_args)
58 case List(List('-', opt)) if is_option1(opt) =>
59 Output.error_message("Command-line option " + print_option(opt) + " requires an argument")
61 case ('-' :: opt :: _) :: _ if !is_option(opt) =>
62 if (opt != '?') Output.error_message("Illegal command-line option " + print_option(opt))