title: Passing Command-Line Arguments to SBT for Setting TypeSafe Config Key-Value
body: <p>Given the following "Main" app:</p>
  
  <pre><code>package net
  
  import com.typesafe.config.ConfigFactory
  
  object Main extends App {
      override def main(args: Array[String]) {
          val x = ConfigFactory.load().getString("app.bar")
          println(s"x: $x")
      }
  }
  </code></pre>
  
  <p>and <code>application.conf</code>:</p>
  
  <pre><code>app {
      bar = ${?BAR}
  }
  </code></pre>
  
  <p>I could pass in the command-line argument via:</p>
  
  <pre><code>$sbt test:run -DBAR=bippy
  [info] Set current project to typesafe_config_env_var 
      (in build file:.../typesafe_config_env_var/)
  [info] Running net.Main 
  x: bippy
  </code></pre>
  
  <p>I wrote this simple example to try to reproduce a <a href="https://groups.google.com/forum/#!topic/scala-user/3QYX4Mcc9Do" rel="nofollow">problem</a> resolving a command-line argument. However, as the output above shows, this test worked successfully.</p>
  
  <p>Is this the standard way of passing command-line arguments in sbt?</p>