Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ul
- trait GetArgs extends Props {
- def argsParse(args: Array[String], sep:String = "=") {
- for (a <- args) {
- val as = a.split(sep)
- if (as.length <= 2) {
- argFind(as(0)) match {
- case Some(attr) =>
- try {
- props.updateString(attr.tag, if (as.length == 2) as(1) else "true")
- } catch { case _:Throwable => }
- case None =>
- }
- }
- }
- }
- def argFind(name:String, sep:String = ";"):Option[PropAttr] =
- props.attrs.find( _.name.split(sep).contains(name));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement