title: Parse CMD arguments and call method in class using DI
body: <p>I would like to parse CMD arguments and if a given string is provided, call a method in a class that uses dependency injection.</p>
  
  <p>I am parsing the CMD args from the SpringBootApplication main method</p>
  
  <pre><code>object SpringbootApplication extends Logger {
    def main(args: Array[String]): Unit = {
      SpringApplication.run(classOf[SpringbootApplication], args :_ *)
      val job = args(0)
      if(job == "prod") {
        // somehow call runPipelineJob
      }
  </code></pre>
  
  <p>The method I'd like to call is in another class:</p>
  
  <pre><code>@Component
  class PipelineMain @Autowired()(
    val jobRunnerService: JobRunnerService) {
  
    def runPipelineJob(): Unit = {
      jobRunnerService.process()
    }
    runPipelineJob()
  </code></pre>
  
  <p>Would like to call that <code>runPipelineJob</code></p>