summaryrefslogtreecommitdiff
path: root/src/main/scala/hbt/Args.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/hbt/Args.scala')
-rw-r--r--src/main/scala/hbt/Args.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/scala/hbt/Args.scala b/src/main/scala/hbt/Args.scala
new file mode 100644
index 00000000..c87ec96b
--- /dev/null
+++ b/src/main/scala/hbt/Args.scala
@@ -0,0 +1,11 @@
+package hbt
+
+import java.nio.{file => jnio}
+
+class Args(val args: IndexedSeq[_], val dest: jnio.Path){
+ def length = args.length
+ def apply[T](index: Int): T = {
+ if (index >= 0 && index < args.length) args(index).asInstanceOf[T]
+ else throw new IndexOutOfBoundsException(s"Index $index outside of range 0 - ${args.length}")
+ }
+}