title: how to parse generic case class fields using scala option parser?
body: <p>I have a case class includes around 20 fields , all of which are primitive types. </p>
  
  <pre><code>case class A( f1: String, f2: Int .....)
  </code></pre>
  
  <p>and I have to parse these fields all from command line (unfortunately). 
  I can , but I really don't want to write this 20 times</p>
  
  <pre><code>opt[String]("f1") required() valueName "&lt;f1&gt;" action { (x, c) =&gt;
      c.copy(f1 = x)
    } text "f1 is required"
  //...repeat 20 times
  </code></pre>
  
  <p>I can obtain the field name and filed type through reflection, but I have no idea how to stuck those information to this call within a for loop</p>
  
  <p>I can connect this with shapeless but I'm still not familiar with that and can this be done without shapeless ?</p>
  
  <p>==</p>
  
  <p>scala option parser => scopt</p>