About 130 results: "ERROR repo:laurenyew/cOrcS"
Page 1 of 7
Filter Results
Sources
Languages
Filter Results
Try Search On







CmdLineParser.scala in cOrcS https://github.com/laurenyew/cOrcS.git | 343 lines | Scala
  1.   abstract class CmdLineOprd(val position: Int, override val argName: String, override val usage: String, override val required: Boolean, override val hidden: Boolean) extends CmdLineOprdOpt(argName, usage, required, hidden) {
  2.     if (recognizedOprds.contains(position)) throw new MultiplyDefinedCmdLineOprndError(position)
  3.     if (shortName != ' ') {
  4.       if (recognizedShortOpts.contains(shortName)) throw new MultiplyDefinedCmdLineOptError(shortName.toString)
  5.     if (longName != null) {
  6.       if (recognizedLongOpts.contains(longName)) throw new MultiplyDefinedCmdLineOptError(longName)
  7.       val position = oprd.position
  8.       if (position > 0 && !recognizedOprds.contains(position - 1)) throw new MissingCmdLineOprdError(position)
  9.       if (position > 0 && oprd.required && !recognizedOprds(position - 1).required) throw new InvalidRequiredCmdLineOprdError(position)
  10.       if (oprd.required) maxReqOprdIndex = maxReqOprdIndex max position
  11. 
                        
  12. class MissingCmdLineOprdError(operandIndex: Int) extends Error("Command line operand number " + operandIndex + " not defined, but operand " + (operandIndex + 1) + " is")
  13. class InvalidRequiredCmdLineOprdError(operandIndex: Int) extends Error("Command line operand number " + operandIndex + " marked required, but operand " + (operandIndex - 1) + " is not")
  14. class MultiplyDefinedCmdLineOprndError(operandIndex: Int) extends Error("Command line operand number " + operandIndex + " multiply defined")
  15. class MultiplyDefinedCmdLineOptError(optName: String) extends Error("Command line option \"" + optName + "\" multiply defined")
  16. 
                        













Back to Top