title: Extending Scopt OptionParser in Scala
body: <p>I'm trying to have a base option parser with some default parameters.</p>
  
  <p>In other projects i would like to extend the option parser with other parameters.</p>
  
  <p>Something like:</p>
  
  <pre><code>case class Config(foo: String = null)
  
  trait DefaultParser { self: OptionParser[Config] =&gt;
    opt[String]('f', "foo") action { (x, c) =&gt;
      c.copy(foo = x)
    }
  }
  
  case class MyConfig(bar: String = "hello world")
  
  trait MyParser { self: OptionParser[MyConfig] =&gt;
    opt[String]('b', "bar") action { (x, c) =&gt;
      c.copy(bar = x)
    }
  }
  </code></pre>
  
  <p>I'm a newbie at <code>Scala</code> and  I'm not sure how I can now use both of them on the same <code>args</code>.</p>
  
  <p>I'm using <code>Scala</code> 2.10 with <code>scopt_2.10</code> v3.3.0.</p>