aboutsummaryrefslogblamecommitdiff
path: root/src/main/scala/api.scala
blob: 44a26f100c4b11d3a95dedece7c7f89d4306f528 (plain) (tree)





























                                                                     
package test

import commando._

object Main {

  val command = cmd("docker")(
    opt("debug", 'D')
  ).sub(
    cmd("run")(
      opt("interactive", 'i'),
      opt("tty", 't'),
      pos("container")
    ).run { arguments =>
      // run container with arguments
    },
    cmd("ps")(
      opt("all", 'a')
    ).run { arguments =>
      if (arguments.contains("all")) {
        // ...
      } else {
        // ...
      }
    }
  )

  def main(args: Array[String]): Unit = commando.parse(args, command)

}